* file.c (file_expand_path): fix wrong behavior for root file.
expand_path("..", "//machine/share") => "//machine/share" expand_path("..", "c:/a") => "c:/" expand_path("..", "/a") => "/" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
42de8af413
commit
79d91e3608
@ -1,3 +1,10 @@
|
|||||||
|
Thu Feb 20 18:44:51 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* file.c (file_expand_path): fix wrong behavior for root file.
|
||||||
|
expand_path("..", "//machine/share") => "//machine/share"
|
||||||
|
expand_path("..", "c:/a") => "c:/"
|
||||||
|
expand_path("..", "/a") => "/"
|
||||||
|
|
||||||
Thu Feb 20 18:11:01 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Thu Feb 20 18:11:01 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* file.c (file_expand_path): should not upward beyond share name.
|
* file.c (file_expand_path): should not upward beyond share name.
|
||||||
|
6
file.c
6
file.c
@ -1434,7 +1434,7 @@ nextdirsep(s)
|
|||||||
return (char *)s;
|
return (char *)s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
|
||||||
static inline char *
|
static inline char *
|
||||||
skipprefix(path)
|
skipprefix(path)
|
||||||
const char *path;
|
const char *path;
|
||||||
@ -1450,9 +1450,11 @@ skipprefix(path)
|
|||||||
if (has_drive_letter(path))
|
if (has_drive_letter(path))
|
||||||
return (char *)(path + 2);
|
return (char *)(path + 2);
|
||||||
#endif
|
#endif
|
||||||
while (isdirsep(*path)) path++;
|
|
||||||
return (char *)path;
|
return (char *)path;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define skipprefix(path) (path)
|
||||||
|
#endif
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
strrdirsep(path)
|
strrdirsep(path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user