summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/file.c b/file.c
index 5c3c3354e78..efee0cb2b21 100644
--- a/file.c
+++ b/file.c
@@ -1245,7 +1245,7 @@ rb_file_s_expand_path(argc, argv)
p = &buf[strlen(buf)];
while (p > buf && *(p - 1) == '/') p--;
}
- else if (isdirsep(*s)) {
+ else {
while (*s && isdirsep(*s)) {
*p++ = '/';
s++;
@@ -1267,7 +1267,8 @@ rb_file_s_expand_path(argc, argv)
}
else {
*++p = '.';
- *++p = '.';
+ do *++p = '.'; while (*++s == '.');
+ --s;
}
break;
case '/':