diff options
| author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-09 04:04:59 +0000 |
|---|---|---|
| committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-09 04:04:59 +0000 |
| commit | 397ba56b095bc1a0626f32635a772d126aa935c0 (patch) | |
| tree | 093c29c0a398eafc3f98985f0e41a35504685040 | |
| parent | 67881f245547c050d1518614a2e6b840b759d6cc (diff) | |
| download | ruby-397ba56b095bc1a0626f32635a772d126aa935c0.tar.gz ruby-397ba56b095bc1a0626f32635a772d126aa935c0.tar.xz ruby-397ba56b095bc1a0626f32635a772d126aa935c0.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@5655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | dir.c | 6 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Mon Feb 9 13:00:55 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> + + * dir.c (fnmatch): + File.fnmatch('*?', 'a') should return true. [ruby-dev:22815] + File.fnmatch('\[1\]' , '[1]') should return true. [ruby-dev:22819] + Sun Feb 8 16:46:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/pp.rb (PP::PPMethods::object_address_group): suppress negative @@ -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; |
