зеркало из https://github.com/github/ruby.git
* 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:
Родитель
478c3e080b
Коммит
479fa40778
|
@ -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
|
||||
|
|
1
string.c
1
string.c
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче