do {
wchar_t *tmp;
- size_t tmp_len;
tmp = php_win32_cp_any_to_w(cur);
if (tmp) {
- tmp_len = wcslen(tmp) + 1;
+ size_t tmp_len = wcslen(tmp) + 1;
memmove(ew + bin_len, tmp, tmp_len * sizeof(wchar_t));
free(tmp);
register struct dirent *dp;
DIR *dirp;
int err;
- char buf[MAXPATHLEN];
/*
* The readdirfunc declaration can't be prototyped, because it is
if ((dirp = g_opendir(pathbuf, pglob)) == NULL) {
/* TODO: don't call for ENOENT or ENOTDIR? */
if (pglob->gl_errfunc) {
+ char buf[MAXPATHLEN];
if (g_Ctoc(pathbuf, buf, sizeof(buf)))
return(GLOB_ABORTED);
if (pglob->gl_errfunc(buf, errno) ||
size_t *limitp;
{
register char **pathv;
- register int i;
u_int newsize, len;
char *copy;
const Char *p;
}
if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
+ register int i;
/* first time around -- clear initial gl_offs items */
pathv += pglob->gl_offs;
for (i = pglob->gl_offs; --i >= 0; )
PW32IO int php_win32_ioutil_unlink_w(const wchar_t *path)
{/*{{{*/
- int ret = 0;
DWORD err = 0;
HANDLE h;
BY_HANDLE_FILE_INFORMATION info;
PW32IO int php_win32_ioutil_rmdir_w(const wchar_t *path)
{/*{{{*/
int ret = 0;
- DWORD err = 0;
PHP_WIN32_IOUTIL_CHECK_PATH_W(path, -1, 0)
if (!RemoveDirectoryW(path)) {
- err = GetLastError();
+ DWORD err = GetLastError();
ret = -1;
SET_ERRNO_FROM_WIN32_CODE(err);
}
PW32IO int php_win32_ioutil_chdir_w(const wchar_t *path)
{/*{{{*/
int ret = 0;
- DWORD err = 0;
if (!SetCurrentDirectoryW(path)) {
- err = GetLastError();
+ DWORD err = GetLastError();
ret = -1;
SET_ERRNO_FROM_WIN32_CODE(err);
}
PW32IO int php_win32_ioutil_rename_w(const wchar_t *oldname, const wchar_t *newname)
{/*{{{*/
int ret = 0;
- DWORD err = 0;
PHP_WIN32_IOUTIL_CHECK_PATH_W(oldname, -1, 0)
PHP_WIN32_IOUTIL_CHECK_PATH_W(newname, -1, 0)
if (!MoveFileExW(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED)) {
- err = GetLastError();
+ DWORD err = GetLastError();
ret = -1;
SET_ERRNO_FROM_WIN32_CODE(err);
}
PW32IO int php_win32_ioutil_access_w(const wchar_t *path, mode_t mode)
{/*{{{*/
- DWORD attr, err;
+ DWORD attr;
if ((mode & X_OK) == X_OK) {
DWORD type;
attr = GetFileAttributesW(path);
if (attr == INVALID_FILE_ATTRIBUTES) {
- err = GetLastError();
+ DWORD err = GetLastError();
SET_ERRNO_FROM_WIN32_CODE(err);
return -1;
}