mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (reg_compile_gen): copy encoding from source string if
non-empty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0f09f59ef7
commit
47732dbd2b
2 changed files with 4 additions and 3 deletions
|
@ -1,8 +1,9 @@
|
|||
Thu Oct 4 16:15:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Thu Oct 4 16:28:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* encoding.c (rb_obj_encoding): returns encoding of the given object.
|
||||
|
||||
* parse.y (reg_compile_gen): copy encoding from source string.
|
||||
* parse.y (reg_compile_gen): copy encoding from source string if
|
||||
non-empty.
|
||||
|
||||
* re.c (Init_Regexp): new method Regexp#encoding.
|
||||
|
||||
|
|
2
parse.y
2
parse.y
|
@ -8170,7 +8170,7 @@ reg_compile_gen(struct parser_params* parser, VALUE str, int options)
|
|||
compile_error(PARSER_ARG "%s", RSTRING_PTR(re));
|
||||
return Qnil;
|
||||
}
|
||||
rb_enc_copy(re, str);
|
||||
if (str) rb_enc_copy(re, str);
|
||||
return re;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue