diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-22 05:39:50 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-22 05:39:50 +0000 |
commit | b270e239aa9a5d170012677b94cdad1a51cc203e (patch) | |
tree | 9684dc7be4ec91f32a0ea09cef73ce8bb39d8fbd /file.c | |
parent | 7945f2c3c8834c72e67da4fc33d0c5a9da49557a (diff) | |
download | ruby-b270e239aa9a5d170012677b94cdad1a51cc203e.tar.gz ruby-b270e239aa9a5d170012677b94cdad1a51cc203e.tar.xz ruby-b270e239aa9a5d170012677b94cdad1a51cc203e.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/trunk@9586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2225,7 +2225,9 @@ rb_path_skip_prefix(const char *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; } |