From 8032f0fde4182ab6153cb2abc98900fe1601c24f Mon Sep 17 00:00:00 2001 From: yugui Date: Mon, 4 May 2009 12:30:26 +0000 Subject: merges r23189 from trunk into ruby_1_9_1. -- * dir.c (bracket): if same in bytes, path is matching. [ruby-dev:38305] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- dir.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index ec645e2e7..f62fc416b 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); -- cgit