mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 14:34:39 +02:00
merges r20603 from trunk into ruby_1_9_1.
* re.c (rb_reg_initialize): raise RegexpError when encoding is dummy encoding. [ruby-dev:37091] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e8c9a7a84f
commit
35aefacb16
2 changed files with 10 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Dec 10 11:25:53 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* re.c (rb_reg_initialize): raise RegexpError when encoding
|
||||
is dummy encoding. [ruby-dev:37091]
|
||||
|
||||
Tue Dec 9 18:35:35 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||
|
||||
* enc/trans/single_byte.trans, cp850-tbl.rb, cp852-tbl.rb,
|
||||
|
|
5
re.c
5
re.c
|
@ -2312,6 +2312,11 @@ rb_reg_initialize(VALUE obj, const char *s, int len, rb_encoding *enc,
|
|||
rb_raise(rb_eTypeError, "already initialized regexp");
|
||||
re->ptr = 0;
|
||||
|
||||
if (rb_enc_dummy_p(enc)) {
|
||||
strcpy(err, "can't make regexp with dummy encoding");
|
||||
return -1;
|
||||
}
|
||||
|
||||
unescaped = rb_reg_preprocess(s, s+len, enc, &fixed_enc, err);
|
||||
if (unescaped == Qnil)
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue