1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* string.c (rb_str_sub_bang): String#sub! now raises an error when

called on a frozen string, even if no change is made.
  See [ruby-core:23657]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
marcandre 2010-04-30 02:48:49 +00:00
parent 478c3e080b
commit 479fa40778
2 changed files with 7 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Fri Apr 30 11:48:31 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* string.c (rb_str_sub_bang): String#sub! now raises an error when
called on a frozen string, even if no change is made.
See [ruby-core:23657]
Fri Apr 30 11:40:44 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* eval.c (make_exception, rb_obj_extend): Fix error messages in case

View file

@ -3466,6 +3466,7 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
}
pat = get_pat(argv[0], 1);
str_modifiable(str);
if (rb_reg_search(pat, str, 0, 0) >= 0) {
rb_encoding *enc;
int cr = ENC_CODERANGE(str);