cvs: php4(PHP_4_2_0) /ext/standard string.c
| From: | Rui Hirokawa | Date: | Thu, 25 Apr 2002 14:52:58 +0000 |
| Subject: | cvs: php4(PHP_4_2_0) /ext/standard string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11435@lists.php.net to get a copy of this message | ||
hirokawa Thu Apr 25 10:52:58 2002 EDT
Modified files: (Branch: PHP_4_2_0)
/php4/ext/standard string.c
Log:
fixed directory access problem when direcory name is encoded in japanese Shift_JIS encoding.
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.263.2.3 php4/ext/standard/string.c:1.263.2.4
--- php4/ext/standard/string.c:1.263.2.3 Thu Mar 28 02:48:50 2002
+++ php4/ext/standard/string.c Thu Apr 25 10:52:58 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.263.2.3 2002/03/28 07:48:50 derick Exp $ */
+/* $Id: string.c,v 1.263.2.4 2002/04/25 14:52:58 hirokawa Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -1051,7 +1051,7 @@
/* strip trailing slashes */
while (*c == '/'
#ifdef PHP_WIN32
- || *c == '\\'
+ || (*c == '\\' && !IsDBCSLeadByte(*(c-1)))
#endif
)
c--;
@@ -1063,7 +1063,7 @@
if ((c = strrchr(s, '/'))
#ifdef PHP_WIN32
- || (c = strrchr(s, '\\'))
+ || ((c = strrchr(s, '\\')) && !IsDBCSLeadByte(*(c-1)))
#endif
) {
ret = estrdup(c + 1);
@@ -1108,7 +1108,7 @@
}
/* Strip trailing slashes */
- while (end >= path && IS_SLASH(*end)) {
+ while (end >= path && IS_SLASH_P(end)) {
end--;
}
if (end < path) {
@@ -1119,7 +1119,7 @@
}
/* Strip filename */
- while (end >= path && !IS_SLASH(*end)) {
+ while (end >= path && !IS_SLASH_P(end)) {
end--;
}
if (end < path) {
@@ -1130,7 +1130,7 @@
}
/* Strip slashes which came before the file name */
- while (end >= path && IS_SLASH(*end)) {
+ while (end >= path && IS_SLASH_P(end)) {
end--;
}
if (end < path) {