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_slice_bang): raise error when the string is frozen.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2011-03-03 09:59:51 +00:00
parent b49993b726
commit 1890364e90
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Thu Mar 3 18:59:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
* string.c (rb_str_slice_bang): raise error when the string is frozen.
Thu Mar 3 14:25:19 2011 NARUSE, Yui <naruse@ruby-lang.org> Thu Mar 3 14:25:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
* strftime.c (STRFTIME): return 0 and ERANGE when precision is too * strftime.c (STRFTIME): return 0 and ERANGE when precision is too

View file

@ -3503,9 +3503,9 @@ rb_str_slice_bang(int argc, VALUE *argv, VALUE str)
for (i=0; i<argc; i++) { for (i=0; i<argc; i++) {
buf[i] = argv[i]; buf[i] = argv[i];
} }
str_modify_keep_cr(str);
result = rb_str_aref_m(argc, buf, str); result = rb_str_aref_m(argc, buf, str);
if (!NIL_P(result)) { if (!NIL_P(result)) {
str_modify_keep_cr(str);
buf[i] = rb_str_new(0,0); buf[i] = rb_str_new(0,0);
rb_str_aset_m(argc+1, buf, str); rb_str_aset_m(argc+1, buf, str);
} }