mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* re.c (rb_reg_initialize_m): fix wrong index for the lang
option's value 'N'. reported by Masaya TARUI via IRC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
01cd3467fb
commit
0e586b35b8
3 changed files with 10 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed May 12 09:21:05 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* re.c (rb_reg_initialize_m): fix wrong index for the lang
|
||||
option's value 'N'. reported by Masaya TARUI via IRC.
|
||||
|
||||
Tue May 11 23:07:22 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/extconf.rb: test IPPROTO_IP and IPPROTO_IPV6 constants.
|
||||
|
|
2
re.c
2
re.c
|
@ -2894,7 +2894,7 @@ rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
|
|||
enc = 0;
|
||||
if (argc == 3 && !NIL_P(argv[2])) {
|
||||
char *kcode = StringValuePtr(argv[2]);
|
||||
if (kcode[0] == 'n' || kcode[1] == 'N') {
|
||||
if (kcode[0] == 'n' || kcode[0] == 'N') {
|
||||
enc = rb_ascii8bit_encoding();
|
||||
flags |= ARG_ENCODING_NONE;
|
||||
}
|
||||
|
|
|
@ -286,6 +286,10 @@ class TestRegexp < Test::Unit::TestCase
|
|||
assert_equal("bar", "foobarbaz"[Regexp.new("b..", nil, "n")])
|
||||
assert_equal(//n, Regexp.new("", nil, "n"))
|
||||
|
||||
arg_encoding_none = 32 # ARG_ENCODING_NONE is implementation defined value
|
||||
assert_equal(arg_encoding_none, Regexp.new("", nil, "n").options)
|
||||
assert_equal(arg_encoding_none, Regexp.new("", nil, "N").options)
|
||||
|
||||
assert_raise(RegexpError) { Regexp.new(")(") }
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue