summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 14:47:06 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 14:47:06 +0000
commit7d6b25443a10bc141da730fb46a9883de9bc00be (patch)
treed5e0358861a98041e0133d8a7d4c325f3298cdbb
parent3be5adeb648ed91bf3f0d63bc65311f1b2fee7fe (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--ChangeLog8
-rw-r--r--regparse.c3
-rw-r--r--test/ruby/test_regexp.rb6
-rw-r--r--version.h2
4 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0084d7e4d9..4683d8e4a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/version.h b/version.h
index 7e2d5c7c77..6fc7293afd 100644
--- a/version.h
+++ b/version.h
@@ -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