зеркало из https://github.com/github/ruby.git
* 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/trunk@20603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e8da366e04
Коммит
d433a70b5d
|
@ -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]
|
||||
|
||||
Wed Dec 10 01:28:16 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* common.mk (win32.obj): depend on headers.
|
||||
|
|
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче