* re.c (rb_reg_initialize_str): /\x80/n is not an error even if script
encoding is EUC-JP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2435067f6c
commit
da42c102c1
@ -1,3 +1,8 @@
|
|||||||
|
Sun Jan 6 01:38:07 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* re.c (rb_reg_initialize_str): /\x80/n is not an error even if script
|
||||||
|
encoding is EUC-JP.
|
||||||
|
|
||||||
Sun Jan 6 00:48:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
Sun Jan 6 00:48:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* lib/resolv.rb (Reolv::DNS#each_address): get A record and then AAAA
|
* lib/resolv.rb (Reolv::DNS#each_address): get A record and then AAAA
|
||||||
|
8
re.c
8
re.c
@ -2035,8 +2035,14 @@ rb_reg_initialize(VALUE obj, const char *s, int len, rb_encoding *enc,
|
|||||||
static int
|
static int
|
||||||
rb_reg_initialize_str(VALUE obj, VALUE str, int options, onig_errmsg_buffer err)
|
rb_reg_initialize_str(VALUE obj, VALUE str, int options, onig_errmsg_buffer err)
|
||||||
{
|
{
|
||||||
return rb_reg_initialize(obj, RSTRING_PTR(str), RSTRING_LEN(str), rb_enc_get(str),
|
int ret;
|
||||||
|
rb_encoding *enc = rb_enc_get(str);
|
||||||
|
if (options & ARG_ENCODING_NONE)
|
||||||
|
enc = rb_ascii8bit_encoding();
|
||||||
|
ret = rb_reg_initialize(obj, RSTRING_PTR(str), RSTRING_LEN(str), enc,
|
||||||
options, err);
|
options, err);
|
||||||
|
RB_GC_GUARD(str);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -382,6 +382,8 @@ class TestM17N < Test::Unit::TestCase
|
|||||||
assert_warning(%r{regexp match /.../n against to UTF-8 string}) {
|
assert_warning(%r{regexp match /.../n against to UTF-8 string}) {
|
||||||
assert_equal(nil, r =~ u("\xc2\xa1"))
|
assert_equal(nil, r =~ u("\xc2\xa1"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert_nothing_raised { eval(e("/\\x80/n")) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_regexp_ascii
|
def test_regexp_ascii
|
||||||
|
Loading…
x
Reference in New Issue
Block a user