Skip to content

Commit

Permalink
* string.c (rb_str_sub_bang): String#sub! now raises an error when
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
marcandre committed Apr 30, 2010
1 parent 478c3e0 commit 479fa40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -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
Expand Down
1 change: 1 addition & 0 deletions string.c
Expand Up @@ -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);
Expand Down

0 comments on commit 479fa40

Please sign in to comment.