diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | re.c | 6 |
2 files changed, 6 insertions, 3 deletions
@@ -3,6 +3,9 @@ Tue Apr 8 10:34:10 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * load.c (rb_require_safe): should check fname path after $SAFE is properly set. [ruby-dev:34268] + * re.c (rb_reg_quote): should always copy the quoting string. + [ruby-core:16235] + Tue Apr 8 10:30:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * common.mk (prelude.c): depends on enc/prelude.rb. @@ -2759,11 +2759,11 @@ rb_reg_quote(VALUE str) } s += clen; } + tmp = rb_str_new3(str); if (ascii_only) { - str = rb_str_new3(str); - rb_enc_associate(str, rb_usascii_encoding()); + rb_enc_associate(tmp, rb_usascii_encoding()); } - return str; + return tmp; meta_found: tmp = rb_str_new(0, RSTRING_LEN(str)*2); |