summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-22 05:48:51 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-22 05:48:51 +0000
commitf2c25bb3e4eb6c0fe738ecda954fbd740d99fc5a (patch)
tree843191b51d7e3dbf335fc52ce93c3e9776b2cf18 /file.c
parent97892c6ac49a0052d7eb647e12dda7ce34167b60 (diff)
downloadruby-f2c25bb3e4eb6c0fe738ecda954fbd740d99fc5a.tar.gz
ruby-f2c25bb3e4eb6c0fe738ecda954fbd740d99fc5a.tar.xz
ruby-f2c25bb3e4eb6c0fe738ecda954fbd740d99fc5a.zip
* file.c (rb_file_s_basename): skip slashes just after UNC top slashes.
* test/ruby/test_path.rb (test_dirname, test_basename): follow new spec. and add new tests. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/file.c b/file.c
index 3c725e457..25d516606 100644
--- a/file.c
+++ b/file.c
@@ -2278,7 +2278,9 @@ rb_path_skip_prefix(path)
#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
#ifdef DOSISH_UNC
if (isdirsep(path[0]) && isdirsep(path[1])) {
- if (*(path = nextdirsep(path + 2)) && path[1] && !isdirsep(path[1]))
+ path += 2;
+ while (isdirsep(*path)) path++;
+ if (*(path = nextdirsep(path)) && path[1] && !isdirsep(path[1]))
path = nextdirsep(path + 1);
return (char *)path;
}