aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index fb0a6f7a6c..87cc64d176 100644
--- a/dir.c
+++ b/dir.c
@@ -534,7 +534,11 @@ extract_path(p, pend)
len = pend - p;
alloc = ALLOC_N(char, len+1);
memcpy(alloc, p, len);
- if (len > 1 && pend[-1] == '/') {
+ if (len > 1 && pend[-1] == '/'
+#if defined DOSISH
+ && len > 2 && pend[-2] != ':'
+#endif
+ ) {
alloc[len-1] = 0;
}
else {
@@ -646,7 +650,11 @@ rb_glob_helper(path, flag, func, arg)
break;
}
+#if defined DOSISH
+#define BASE (*base && !((isdirsep(*base) && !base[1]) || (base[1] == ':' && isdirsep(base[2]) && !base[3])))
+#else
#define BASE (*base && !(*base == '/' && !base[1]))
+#endif
for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
if (recursive) {