From 4ebbd82e9d1336f9e97c1fe5a4dde7c014e84c06 Mon Sep 17 00:00:00 2001 From: ocean Date: Sat, 7 Feb 2004 12:51:57 +0000 Subject: * 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 --- dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index 1086658f0..0f70770ce 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; -- cgit