mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* dir.c (rb_glob_helper): fix drive letter handling on DOSISH.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
390a12cf4c
commit
037dacc510
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Mar 13 16:39:45 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||
|
||||
* dir.c (rb_glob_helper): fix drive letter handling on DOSISH.
|
||||
|
||||
Tue Mar 13 14:54:39 2001 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
|
||||
|
||||
* lib/net/http.rb: add HTTPRequest#basic_auth.
|
||||
|
|
10
dir.c
10
dir.c
|
@ -534,7 +534,11 @@ extract_path(p, pend)
|
|||
len = pend - p;
|
||||
alloc = ALLOC_N(char, len+1);
|
||||
memcpy(alloc, p, len);
|
||||
if (len > 1 && pend[-1] == '/') {
|
||||
if (len > 1 && pend[-1] == '/'
|
||||
#if defined DOSISH
|
||||
&& len > 2 && pend[-2] != ':'
|
||||
#endif
|
||||
) {
|
||||
alloc[len-1] = 0;
|
||||
}
|
||||
else {
|
||||
|
@ -646,7 +650,11 @@ rb_glob_helper(path, flag, func, arg)
|
|||
break;
|
||||
}
|
||||
|
||||
#if defined DOSISH
|
||||
#define BASE (*base && !((isdirsep(*base) && !base[1]) || (base[1] == ':' && isdirsep(base[2]) && !base[3])))
|
||||
#else
|
||||
#define BASE (*base && !(*base == '/' && !base[1]))
|
||||
#endif
|
||||
|
||||
for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
|
||||
if (recursive) {
|
||||
|
|
Loading…
Reference in a new issue