summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/file.c b/file.c
index 3c725e457b..25d516606d 100644
--- a/file.c
+++ b/file.c
@@ -2278,7 +2278,9 @@ rb_path_skip_prefix(path)
#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
#ifdef DOSISH_UNC
if (isdirsep(path[0]) && isdirsep(path[1])) {
- if (*(path = nextdirsep(path + 2)) && path[1] && !isdirsep(path[1]))
+ path += 2;
+ while (isdirsep(*path)) path++;
+ if (*(path = nextdirsep(path)) && path[1] && !isdirsep(path[1]))
path = nextdirsep(path + 1);
return (char *)path;
}