diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-09-16 09:40:33 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-09-16 09:40:33 +0000 |
commit | 21d0b0785c4be76fac8c421af009aa57fbbb85f5 (patch) | |
tree | ea994af7deeef43977f60a9ab26131e8cd90a9a0 /file.c | |
parent | 1f72ff9b643dff5f4c5a40bf672a2525d66bd99f (diff) | |
download | ruby-21d0b0785c4be76fac8c421af009aa57fbbb85f5.tar.gz ruby-21d0b0785c4be76fac8c421af009aa57fbbb85f5.tar.xz ruby-21d0b0785c4be76fac8c421af009aa57fbbb85f5.zip |
1.4.1
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1107,7 +1107,7 @@ rb_file_s_expand_path(argc, argv) } } #endif - else if (s[0] != '/') { + else if (!isdirsep(*s)) { if (argc == 2) { dname = rb_file_s_expand_path(1, &dname); strcpy(buf, RSTRING(dname)->ptr); @@ -1122,6 +1122,13 @@ rb_file_s_expand_path(argc, argv) p = &buf[strlen(buf)]; while (p > buf && *(p - 1) == '/') p--; } + else if (isdirsep(*s)) { + while (*s && isdirsep(*s)) { + *p++ = '/'; + s++; + } + if (p > buf && *s) p--; + } *p = '/'; for ( ; *s; s++) { |