diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-25 14:47:06 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-25 14:47:06 +0000 |
| commit | 7d6b25443a10bc141da730fb46a9883de9bc00be (patch) | |
| tree | d5e0358861a98041e0133d8a7d4c325f3298cdbb | |
| parent | 3be5adeb648ed91bf3f0d63bc65311f1b2fee7fe (diff) | |
merges r24546 from trunk into ruby_1_9_1.
--
* regparse.c (add_ctype_to_cc_by_range): fix the first
character bigger than sb_out was dropped.
* test/ruby/test_regexp.rb (TestRegexp#test_posix_bracket):
add tests for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@25484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | regparse.c | 3 | ||||
| -rw-r--r-- | test/ruby/test_regexp.rb | 6 | ||||
| -rw-r--r-- | version.h | 2 |
4 files changed, 16 insertions, 3 deletions
@@ -1,3 +1,11 @@ +Sun Aug 16 01:10:00 2009 NARUSE, Yui <naruse@ruby-lang.org> + + * regparse.c (add_ctype_to_cc_by_range): fix the first + character bigger than sb_out was dropped. + + * test/ruby/test_regexp.rb (TestRegexp#test_posix_bracket): + add tests for above. + Fri Aug 14 14:31:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * configure.in (rubyhdrdir): fixed typo. [ruby-dev:39079] diff --git a/regparse.c b/regparse.c index 8a02966def..87008221f6 100644 --- a/regparse.c +++ b/regparse.c @@ -3768,8 +3768,7 @@ add_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int not, for (j = ONIGENC_CODE_RANGE_FROM(mbr, i); j <= ONIGENC_CODE_RANGE_TO(mbr, i); j++) { if (j >= sb_out) { - if (j == ONIGENC_CODE_RANGE_TO(mbr, i)) i++; - else if (j > ONIGENC_CODE_RANGE_FROM(mbr, i)) { + if (j > ONIGENC_CODE_RANGE_FROM(mbr, i)) { r = add_code_range_to_buf(&(cc->mbuf), j, ONIGENC_CODE_RANGE_TO(mbr, i)); if (r != 0) return r; diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index d6441c9573..82e18f21e2 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -671,6 +671,12 @@ class TestRegexp < Test::Unit::TestCase failcheck('[[:alpha') failcheck('[[:alpha:') failcheck('[[:alp:]]') + + assert_match(/\A[[:digit:]]+\z/, "\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19") + assert_match(/\A[[:alnum:]]+\z/, "\uff10\uff19\uff41\uff5a\uff21\uff3a") + assert_match(/\A[[:space:]]+\z/, "\r\n\v\f\r\s\u0085") + assert_match(/\A[[:ascii:]]+\z/, "\x00\x7F") + assert_no_match(/[[:ascii:]]/, "\x80\xFF") end def test_backward @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 290 +#define RUBY_PATCHLEVEL 291 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |
