summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-09 04:04:59 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-09 04:04:59 +0000
commite95d01cd783a9fd60e04e280fbbcd6823f6ef314 (patch)
tree093c29c0a398eafc3f98985f0e41a35504685040 /dir.c
parent637c337400fbe5e35ee0bf3c9660157e79fd5bf5 (diff)
* dir.c (fnmatch):
File.fnmatch('*?', 'a') should return true. [ruby-dev:22815] File.fnmatch('\[1\]' , '[1]') should return true. [ruby-dev:22819] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index 07dd806..071a5aa 100644
--- a/dir.c
+++ b/dir.c
@@ -178,7 +178,7 @@ fnmatch(pat, string, flags)
test = downcase(test);
pat--;
while (*s) {
- if ((c == '[' || downcase(*s) == test) &&
+ if ((c == '?' || c == '[' || downcase(*s) == test) &&
!fnmatch(pat, s, flags | FNM_DOTMATCH))
return 0;
else if (ISDIRSEP(*s))
@@ -186,7 +186,7 @@ fnmatch(pat, string, flags)
s++;
}
return FNM_NOMATCH;
-
+
case '[':
if (!*s || ISDIRSEP(*s) || PERIOD(s))
return FNM_NOMATCH;
@@ -199,7 +199,7 @@ fnmatch(pat, string, flags)
case '\\':
if (escape
#if defined DOSISH
- && *pat && strchr("*?[\\", *pat)
+ && *pat && strchr("*?[]\\", *pat)
#endif
) {
c = *pat;