diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-08 06:32:40 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-08 06:32:40 +0000 |
commit | 44175158a2d9b091b06944a35ef42d747472651d (patch) | |
tree | a545f9cfba393ac405e6d4e3517302f9d8a06ac1 /dir.c | |
parent | 5b989069366705b7fdfe19ac43bbe1a0cd798837 (diff) |
* dir.c (range): treat incomplete '[' as ordinary character (like
has_magic does).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -97,6 +97,7 @@ range(pat, test, flags) char test; int flags; { + char *first = pat; int not, ok = 0; int nocase = flags & FNM_CASEFOLD; int escape = !(flags & FNM_NOESCAPE); @@ -119,13 +120,13 @@ range(pat, test, flags) pat++; cend = pat[1]; if (!cend) - return 0; + break; pat += 2; } if (downcase(cstart) <= test && test <= downcase(cend)) ok = 1; } - return 0; + return test == '[' ? first : 0; } #define ISDIRSEP(c) (pathname && isdirsep(c)) |