diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-13 07:58:07 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-13 07:58:07 +0000 |
commit | 037dacc5102b3235c7643b021070807846a2c228 (patch) | |
tree | 7a475fb0b272289a221e164aaae14989292afb3d /dir.c | |
parent | 390a12cf4c731eae799518f262ed02ddac96e2ac (diff) |
* 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
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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) { |