ruby-changes:25121
From: usa <ko1@a...>
Date: Sat, 13 Oct 2012 01:47:16 +0900 (JST)
Subject: [ruby-changes:25121] usa:r37173 (ruby_1_9_3): * regparse.c (parse_char_class): also need to check the type of token
usa 2012-10-13 01:47:05 +0900 (Sat, 13 Oct 2012) New Revision: 37173 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37173 Log: * 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]. Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/regparse.c branches/ruby_1_9_3/version.h Index: ruby_1_9_3/regparse.c =================================================================== --- ruby_1_9_3/regparse.c (revision 37172) +++ ruby_1_9_3/regparse.c (revision 37173) @@ -4491,7 +4491,10 @@ 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; Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 37172) +++ ruby_1_9_3/ChangeLog (revision 37173) @@ -1,3 +1,10 @@ +Sat Oct 13 01:41:38 2012 NAKAMURA Usaku <usa@r...> + + * 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@r...> * test/ruby/test_regexp.rb Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 37172) +++ ruby_1_9_3/version.h (revision 37173) @@ -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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/