]> granicus.if.org Git - php/commitdiff
fixed access problem when japanese Shift_JIS character is used as directory name...
authorRui Hirokawa <hirokawa@php.net>
Tue, 23 Apr 2002 14:55:10 +0000 (14:55 +0000)
committerRui Hirokawa <hirokawa@php.net>
Tue, 23 Apr 2002 14:55:10 +0000 (14:55 +0000)
TSRM/tsrm_virtual_cwd.c
win32/readdir.c

index ae8efd93e467eec14e6f89955d0af60ea8603361..9c1a5d29256dfd128073590ab426d89e05fdc86e 100644 (file)
@@ -68,7 +68,8 @@ cwd_state main_cwd_state; /* True global */
 #endif
 
 #ifdef TSRM_WIN32
-#define tsrm_strtok_r(a,b,c) strtok((a),(b))
+#include <tchar.h>
+#define tsrm_strtok_r(a,b,c) _tcstok((a),(b))
 #define TOKENIZER_STRING "/\\"
        
 static int php_check_dots(const char *element, int n) 
index 8c17ce2b225953181d75d9ed0674e941f0e87c47..694a409c35f25afc0922cfe0c51e6498a2f7f33e 100644 (file)
@@ -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, "/*");