From 40412b77305befcaffd0f3fcf85d6cd8f2d75f3d Mon Sep 17 00:00:00 2001 From: eban Date: Mon, 25 Sep 2000 07:00:55 +0000 Subject: eban git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- dir.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index 6bdff19d20..efb28e6848 100644 --- a/dir.c +++ b/dir.c @@ -511,11 +511,9 @@ has_magic(s, send) return Qtrue; continue; -#if !defined DOSISH case '\\': if (*p++ == '\0') return Qfalse; -#endif } if (send && p >= send) break; @@ -533,7 +531,7 @@ extract_path(p, pend) len = pend - p; alloc = ALLOC_N(char, len+1); memcpy(alloc, p, len); - if (len > 1 && isdirsep(pend[-1])) { + if (len > 1 && pend[-1] == '/') { alloc[len-1] = 0; } else { @@ -549,7 +547,7 @@ extract_elem(path) { char *pend; - pend = find_dirsep(path); + pend = strchr(path, '/'); if (!pend) pend = path + strlen(path); return extract_path(path, pend); @@ -577,8 +575,8 @@ rb_glob(path, func, arg) p = path; while (p) { - if (isdirsep(*p)) p++; - m = find_dirsep(p); + if (*p == '/') p++; + m = strchr(p, '/'); if (has_magic(p, m)) { char *dir, *base, *magic, *buf; DIR *dirp; @@ -607,7 +605,7 @@ rb_glob(path, func, arg) free(base); break; } -#define BASE (*base && !(isdirsep(*base) && !base[1])) +#define BASE (*base && !(*base == '/' && !base[1])) for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) { if (recursive) { -- cgit v1.2.3