summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-20 09:44:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-20 09:44:54 +0000
commita20e4855d611098f269ded64135bd4c5f1e5f130 (patch)
tree009e5492a79483162fd33986fbb2cce714851bdc /file.c
parent8cffb643507650d238c1cdc1e36a6a769ece8cb8 (diff)
downloadruby-a20e4855d611098f269ded64135bd4c5f1e5f130.tar.gz
ruby-a20e4855d611098f269ded64135bd4c5f1e5f130.tar.xz
ruby-a20e4855d611098f269ded64135bd4c5f1e5f130.zip
* file.c (file_expand_path): fix wrong behavior for root file.
expand_path("..", "//machine/share") => "//machine/share" expand_path("..", "c:/a") => "c:/" expand_path("..", "/a") => "/" git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/file.c b/file.c
index 3578b17a1..407a76d8a 100644
--- a/file.c
+++ b/file.c
@@ -1434,7 +1434,7 @@ nextdirsep(s)
return (char *)s;
}
-
+#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
static inline char *
skipprefix(path)
const char *path;
@@ -1450,9 +1450,11 @@ skipprefix(path)
if (has_drive_letter(path))
return (char *)(path + 2);
#endif
- while (isdirsep(*path)) path++;
return (char *)path;
}
+#else
+#define skipprefix(path) (path)
+#endif
static char *
strrdirsep(path)