summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-07 12:51:57 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-07 12:51:57 +0000
commitb839a4d72000489b10f2ffdaccddfae23fa00a7b (patch)
tree2e98f1dba50e2ed58c29f836f72bff84924dbb1c /dir.c
parent776206b3e7a1374e8517431c9f63745079b3b1bf (diff)
* dir.c (fnmatch):
File.fnmatch('\[1\]' , '[1]') should return true. [ruby-dev:22815] File.fnmatch('*?', 'a') should return true. [ruby-dev:22819] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index 1086658f0d..0f70770ce6 100644
--- a/dir.c
+++ b/dir.c
@@ -267,7 +267,7 @@ fnmatch(pat, string, flags)
test = escape && c == '\\' ? pat+1 : pat;
while (*s) {
- if ((c == '[' || Compare(s, test) == 0) &&
+ if ((c == '?' || c == '[' || Compare(s, test) == 0) &&
!fnmatch(pat, s, flags | FNM_DOTMATCH))
return 0;
else if (ISDIRSEP(*s))
@@ -288,7 +288,7 @@ fnmatch(pat, string, flags)
case '\\':
if (escape && pat[1]
#if defined DOSISH
- && strchr("*?[\\", pat[1])
+ && strchr("*?[]\\", pat[1])
#endif
) {
c = *++pat;