summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-21 15:18:05 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-21 15:18:05 +0000
commitadb111e23562ec48c8a2fdf7429c759b9600019c (patch)
treebe97ae8e4d33f6ab3a9de3ffea79d6ec7a9a5b53 /win32
parent2f9d8f4b6bce0faf70b659df7726b68a12005972 (diff)
* win32/win32.c (isUNCRoot): multibyte character support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 828d932b13..bf0165e8ac 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2599,13 +2599,16 @@ isUNCRoot(const char *path)
{
if (path[0] == '\\' && path[1] == '\\') {
const char *p;
- if (p = strchr(path + 3, '\\')) {
- if (!p[1])
- return 0;
- if (p = strchr(p + 1, '\\')) {
- if (!p[1])
- return 1;
- } else
+ for (p = path + 3; *p; p = CharNext(p)) {
+ if (*p == '\\')
+ break;
+ }
+ if (p[0] && p[1]) {
+ for (p++; *p; p = CharNext(p)) {
+ if (*p == '\\')
+ break;
+ }
+ if (!p[0] || !p[1])
return 1;
}
}