diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-24 09:37:36 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-24 09:37:36 +0000 |
commit | 29160356f2166e8b11d5fd1fa70da85579914437 (patch) | |
tree | 47eaf899f270e093cd10bdbc8304e444a8fae36b /dir.c | |
parent | 911692e5684749c293bed767d0c6c37a29833383 (diff) |
merges r29306 from trunk into ruby_1_9_2.
--
* dir.c (bracket): get rid of scanning at the end of the pattern
string, not to raise an exception while globbing command line.
[ruby-core:32478]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@29916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -108,6 +108,7 @@ bracket( int r; int ok = 0, not = 0; + if (p >= pend) return NULL; if (*p == '!' || *p == '^') { not = 1; p++; @@ -120,6 +121,7 @@ bracket( if (!*t1) return NULL; p = t1 + (r = rb_enc_mbclen(t1, pend, enc)); + if (p >= pend) return NULL; if (p[0] == '-' && p[1] != ']') { const char *t2 = p + 1; int r2; |