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 | 4ebbd82e9d1336f9e97c1fe5a4dde7c014e84c06 (patch) | |
| tree | 2e98f1dba50e2ed58c29f836f72bff84924dbb1c /dir.c | |
| parent | 9782077515b6c95e13e97b429ccbed2f78934fc0 (diff) | |
| download | ruby-4ebbd82e9d1336f9e97c1fe5a4dde7c014e84c06.tar.gz ruby-4ebbd82e9d1336f9e97c1fe5a4dde7c014e84c06.tar.xz ruby-4ebbd82e9d1336f9e97c1fe5a4dde7c014e84c06.zip | |
* 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: http://svn.ruby-lang.org/repos/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; |
