diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-21 15:18:05 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-21 15:18:05 +0000 |
commit | 22198c30b115dd69227dfa3a006c323576067fe8 (patch) | |
tree | ca5c08a9084025f516f84820934fd08d0ff6f0c1 /win32 | |
parent | 424c3fb43d59d7e47952152ff03ba6ea6c6b3d22 (diff) |
* win32/win32.c (isUNCRoot): multibyte character support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/win32/win32.c b/win32/win32.c index 55e863be94..54ad44ae33 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2668,13 +2668,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; } } |