From: Rui Hirokawa Date: Mon, 22 Apr 2002 22:14:39 +0000 (+0000) Subject: fixed access problem when japanese Shift_JIS character is used as directory name... X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~493 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36e51815ad8ce90c69a3a55ddca79fb40304a467;p=php fixed access problem when japanese Shift_JIS character is used as directory name. Some characters in Shift_JIS are including 0x5c (slash) as second byte. --- diff --git a/win32/readdir.c b/win32/readdir.c index 8c17ce2b22..694a409c35 100644 --- a/win32/readdir.c +++ b/win32/readdir.c @@ -29,7 +29,8 @@ DIR *opendir(const char *dir) filespec = malloc(strlen(dir) + 2 + 1); strcpy(filespec, dir); index = strlen(filespec) - 1; - if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\')) + if (index >= 0 && (filespec[index] == '/' || + (filespec[index] == '\\' && !IsDBCSLeadByte(filespec[index-1])))) filespec[index] = '\0'; strcat(filespec, "/*");