From 8fe2085eb774e216da8298eaf922c1c928a49905 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 17 Feb 2003 04:27:45 +0000 Subject: *** empty log message *** git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/file.c b/file.c index cb7c2c8814..581e490cac 100644 --- a/file.c +++ b/file.c @@ -1591,7 +1591,6 @@ file_expand_path(fname, dname, result) strcpy(buf, dir); free(dir); } - p = skiproot(buf); #ifdef DOSISH if (isdirsep(*s)) { /* specified full path, but not drive letter nor UNC */ @@ -1601,24 +1600,24 @@ file_expand_path(fname, dname, result) } else if (isdirsep(buf[0]) && isdirsep(buf[1])) { /* or UNC share name */ - if (*(p = nextdirsep(p))) p = nextdirsep(p + 1); + if (*(p = nextdirsep(buf + 2))) p = nextdirsep(p + 1); } } else #endif - if (*p) - p = chompdirsep(p); - else if (p > buf) - --p; + p = chompdirsep(skiproot(buf)); } else { b = s; do s++; while (isdirsep(*s)); - p = buf + (s - b) - 1; + p = buf + (s - b); BUFCHECK(p >= pend); memset(buf, '/', p - buf); } - *p = '/'; + if (p > buf && p[-1] == '/') + --p; + else + *p = '/'; b = s; while (*s) { -- cgit v1.2.3