summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-12 16:47:05 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-12 16:47:05 +0000
commit88e264d23d88cb76eadad85c76e97deff8260493 (patch)
tree54870ecc803086349ab43fa326f85a16e4a0e9b9
parentcc251c2f9fd3f030c366a1777ba4fb53e8dc30d1 (diff)
* regparse.c (parse_char_class): also need to check the type of token
after raw hyphen in regexp class, because the charcter code area is union'ed with the property of TK_CHAR_TYPE. reported by Bushi Zhang at [ruby-core:47115] [Backport #6853]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--regparse.c5
-rw-r--r--version.h2
3 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ac5250317..e24c70bbdc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Oct 13 01:41:38 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * regparse.c (parse_char_class): also need to check the type of token
+ after raw hyphen in regexp class, because the charcter code area
+ is union'ed with the property of TK_CHAR_TYPE.
+ reported by Bushi Zhang at [ruby-core:47115] [Backport #6853].
+
Sat Oct 13 01:39:46 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_regexp.rb
diff --git a/regparse.c b/regparse.c
index 1489f0e58d..2b4c0bf5bb 100644
--- a/regparse.c
+++ b/regparse.c
@@ -4491,7 +4491,10 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC)) {
CC_ESC_WARN(env, (UChar* )"-");
- goto sb_char; /* [0-9-a] is allowed as [0-9\-a] */
+ if (tok->type == TK_CHAR_TYPE)
+ goto next_class; /* [0-9-\s] is allowed as [0-9\-\s] */
+ else
+ goto sb_char; /* [0-9-a] is allowed as [0-9\-a] */
}
r = ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS;
goto err;
diff --git a/version.h b/version.h
index 64d445fb10..648bdae4d7 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 287
+#define RUBY_PATCHLEVEL 288
#define RUBY_RELEASE_DATE "2012-10-13"
#define RUBY_RELEASE_YEAR 2012