cvs: TSRM / tsrm_virtual_cwd.c tsrm_virtual_cwd.h
| From: | Rui Hirokawa | Date: | Thu, 25 Apr 2002 14:42:55 +0000 |
| Subject: | cvs: TSRM / tsrm_virtual_cwd.c tsrm_virtual_cwd.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11432@lists.php.net to get a copy of this message | ||
hirokawa Thu Apr 25 10:42:55 2002 EDT
Modified files:
/TSRM tsrm_virtual_cwd.c tsrm_virtual_cwd.h
Log:
fixed directory access problem when direcory name is encoded in japanese Shift_JIS encoding.
Index: TSRM/tsrm_virtual_cwd.c
diff -u TSRM/tsrm_virtual_cwd.c:1.28 TSRM/tsrm_virtual_cwd.c:1.29
--- TSRM/tsrm_virtual_cwd.c:1.28 Sun Apr 21 18:20:14 2002
+++ TSRM/tsrm_virtual_cwd.c Thu Apr 25 10:42:55 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_virtual_cwd.c,v 1.28 2002/04/21 22:20:14 hirokawa Exp $ */
+/* $Id: tsrm_virtual_cwd.c,v 1.29 2002/04/25 14:42:55 hirokawa Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
@@ -364,7 +364,8 @@
state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1);
#ifdef TSRM_WIN32
/* Windows 9x will consider C:\\Foo as a network path. Avoid it. */
- if (state->cwd[state->cwd_length-1]!='\\' &&
state->cwd[state->cwd_length-1]!='/') {
+ if ((state->cwd[state->cwd_length-1]!='\\' &&
state->cwd[state->cwd_length-1]!='/') ||
+ IsDBCSLeadByte(state->cwd[state->cwd_length-2])) {
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
}
#else
Index: TSRM/tsrm_virtual_cwd.h
diff -u TSRM/tsrm_virtual_cwd.h:1.17 TSRM/tsrm_virtual_cwd.h:1.18
--- TSRM/tsrm_virtual_cwd.h:1.17 Tue Dec 11 10:16:20 2001
+++ TSRM/tsrm_virtual_cwd.h Thu Apr 25 10:42:55 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_virtual_cwd.h,v 1.17 2001/12/11 15:16:20 sebastian Exp $ */
+/* $Id: tsrm_virtual_cwd.h,v 1.18 2002/04/25 14:42:55 hirokawa Exp $ */
#ifndef VIRTUAL_CWD_H
#define VIRTUAL_CWD_H
@@ -50,6 +50,8 @@
#define DEFAULT_SLASH '\\'
#define DEFAULT_DIR_SEPARATOR ';'
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
+#define IS_SLASH_P(c) (*(c) == '/' || \
+ (*(c) == '\\' && !IsDBCSLeadByte(*(c-1))))
#define COPY_WHEN_ABSOLUTE 2
#define IS_ABSOLUTE_PATH(path, len) \
(len >= 2 && isalpha(path[0]) && path[1] == ':')
@@ -70,6 +72,7 @@
#endif
#define IS_SLASH(c) ((c) == '/')
+#define IS_SLASH_P(c) (*(c) == '/')
#endif