summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/file.c b/file.c
index 257a086aad..eb6d2e01ef 100644
--- a/file.c
+++ b/file.c
@@ -1464,12 +1464,15 @@ rb_file_s_expand_path(argc, argv)
}
BUFCHECK(strlen(dir) > buflen);
strcpy(buf, dir);
- for (p = buf; p < buf + strlen(dir); p = CharNext(p)) {
- if (isdirsep(*p)) {
+#ifdef DOSISH
+ for (p = buf; *p; p = CharNext(p)) {
+ if (*p == '\\') {
*p = '/';
}
}
+#else
p = buf + strlen(dir);
+#endif
s++;
tainted = 1;
}