From 333e8b294d4c7afb7a56cb4ea2b2c2820d5b17a6 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 22 Nov 2005 05:39:50 +0000 Subject: * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@9586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'file.c') diff --git a/file.c b/file.c index 57069cf3bb..873087c590 100644 --- a/file.c +++ b/file.c @@ -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; } -- cgit v1.2.3