From 232449ed557be7899e71e26bbf4d9ac76c10b69b Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 14 Jun 2008 07:56:06 +0000 Subject: [PATCH] * file.c (file_expand_path): no need to expand root path which has no short file name. [ruby-dev:35095] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ file.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bbef7c50ab..84a82985cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Jun 14 16:55:46 2008 Nobuyoshi Nakada + + * file.c (file_expand_path): no need to expand root path which has no + short file name. [ruby-dev:35095] + Fri Jun 13 23:08:02 2008 Tanaka Akira * lib/time.rb (Time.xmlschema): don't accept decimal dot diff --git a/file.c b/file.c index 60d5a94300..ba490c0894 100644 --- a/file.c +++ b/file.c @@ -2746,14 +2746,14 @@ file_expand_path(fname, dname, result) #if USE_NTFS *p = '\0'; - if (*(s = skipprefix(b = buf)) && !strpbrk(s, "*?")) { + if ((s = strrdirsep(b = buf)) != 0 && !strpbrk(s, "*?")) { size_t len; WIN32_FIND_DATA wfd; #ifdef __CYGWIN__ int lnk_added = 0, is_symlink = 0; struct stat st; char w32buf[MAXPATHLEN]; - p = strrdirsep(s); + p = (char *)s; if (lstat(buf, &st) == 0 && S_ISLNK(st.st_mode)) { is_symlink = 1; *p = '\0'; @@ -2782,7 +2782,7 @@ file_expand_path(fname, dname, result) wfd.cFileName[len -= 4] = '\0'; } #else - p = strrdirsep(s); + p = (char *)s; #endif ++p; BUFCHECK(bdiff + len >= buflen);