summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-18 07:38:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-18 07:38:48 +0000
commit77ffc8bf3fec9e5b0e5d34b765b2285d4cda2090 (patch)
tree47e65ee28f75dcd404b12e95d6ff514d93050daa /dir.c
parent41a8d90e7b884f3811eb65fa7cad566ff235890a (diff)
* dir.c (fnmatch): unlike find_dirsep(), rb_path_next() never
return NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/dir.c b/dir.c
index 8572441..73c6238 100644
--- a/dir.c
+++ b/dir.c
@@ -90,7 +90,6 @@ char *strchr _((char*,char));
#else
#define isdirsep(c) ((c) == '/')
#endif
-#define find_dirsep(s) rb_path_next(s)
static char *
range(pat, test, flags)
@@ -161,14 +160,14 @@ fnmatch(pat, string, flags)
return FNM_NOMATCH;
if (!c) {
- if (pathname && find_dirsep(s))
+ if (pathname && *rb_path_next(s))
return FNM_NOMATCH;
else
return 0;
}
else if (ISDIRSEP(c)) {
- s = find_dirsep(s);
- if (s) {
+ s = rb_path_next(s);
+ if (*s) {
s++;
break;
}