mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
637c337400
commit
e95d01cd78
2 changed files with 9 additions and 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>
|
Sun Feb 8 16:46:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/pp.rb (PP::PPMethods::object_address_group): suppress negative
|
* lib/pp.rb (PP::PPMethods::object_address_group): suppress negative
|
||||||
|
|
6
dir.c
6
dir.c
|
@ -178,7 +178,7 @@ fnmatch(pat, string, flags)
|
||||||
test = downcase(test);
|
test = downcase(test);
|
||||||
pat--;
|
pat--;
|
||||||
while (*s) {
|
while (*s) {
|
||||||
if ((c == '[' || downcase(*s) == test) &&
|
if ((c == '?' || c == '[' || downcase(*s) == test) &&
|
||||||
!fnmatch(pat, s, flags | FNM_DOTMATCH))
|
!fnmatch(pat, s, flags | FNM_DOTMATCH))
|
||||||
return 0;
|
return 0;
|
||||||
else if (ISDIRSEP(*s))
|
else if (ISDIRSEP(*s))
|
||||||
|
@ -186,7 +186,7 @@ fnmatch(pat, string, flags)
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
case '[':
|
case '[':
|
||||||
if (!*s || ISDIRSEP(*s) || PERIOD(s))
|
if (!*s || ISDIRSEP(*s) || PERIOD(s))
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
@ -199,7 +199,7 @@ fnmatch(pat, string, flags)
|
||||||
case '\\':
|
case '\\':
|
||||||
if (escape
|
if (escape
|
||||||
#if defined DOSISH
|
#if defined DOSISH
|
||||||
&& *pat && strchr("*?[\\", *pat)
|
&& *pat && strchr("*?[]\\", *pat)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
c = *pat;
|
c = *pat;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue