From 36e51815ad8ce90c69a3a55ddca79fb40304a467 Mon Sep 17 00:00:00 2001 From: Rui Hirokawa Date: Mon, 22 Apr 2002 22:14:39 +0000 Subject: [PATCH] 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. --- win32/readdir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, "/*"); -- 2.50.1