diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-07 12:51:57 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-07 12:51:57 +0000 |
commit | b839a4d72000489b10f2ffdaccddfae23fa00a7b (patch) | |
tree | 2e98f1dba50e2ed58c29f836f72bff84924dbb1c /dir.c | |
parent | 776206b3e7a1374e8517431c9f63745079b3b1bf (diff) | |
download | ruby-b839a4d72000489b10f2ffdaccddfae23fa00a7b.tar.gz |
* 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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |