summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-14 09:11:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-14 09:11:29 +0000
commit205c4b490cf4d66484f7357646cbf8748e427c5b (patch)
tree769595d85b73a01c6c49c1cadc44a4d5bba115d3 /dir.c
parent946fe69932080cad33fd951d32eb68577befb61a (diff)
* dir.c (bracket): if same in bytes, path is matching.
[ruby-dev:38305] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index 14b4872a1d..522818b663 100644
--- a/dir.c
+++ b/dir.c
@@ -109,7 +109,7 @@ bracket(
t1++;
if (!*t1)
return NULL;
- p += (r = rb_enc_mbclen(p, pend, enc));
+ p += (r = rb_enc_mbclen(t1, pend, enc));
if (p[0] == '-' && p[1] != ']') {
const char *t2 = p + 1;
int r2;
@@ -135,7 +135,10 @@ bracket(
}
else {
if (ok) continue;
- if (r <= (send-s) && memcmp(p, s, r) == 0) continue;
+ if (r <= (send-s) && memcmp(t1, s, r) == 0) {
+ ok = 1;
+ continue;
+ }
if (!nocase) continue;
c1 = rb_enc_toupper(rb_enc_codepoint(s, send, enc), enc);
c2 = rb_enc_toupper(rb_enc_codepoint(p, pend, enc), enc);