diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-03 09:59:51 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-03 09:59:51 +0000 |
commit | 1890364e90a5934988c6c853965ebdc6768b16bc (patch) | |
tree | 1039c64633798a87ab0ce3aa9f8c06d8d2556e36 | |
parent | b49993b726a7986877dad7c8c566613bf801c516 (diff) | |
download | ruby-1890364e90a5934988c6c853965ebdc6768b16bc.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | string.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -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> * strftime.c (STRFTIME): return 0 and ERANGE when precision is too @@ -3503,9 +3503,9 @@ rb_str_slice_bang(int argc, VALUE *argv, VALUE str) for (i=0; i<argc; i++) { buf[i] = argv[i]; } + str_modify_keep_cr(str); result = rb_str_aref_m(argc, buf, str); if (!NIL_P(result)) { - str_modify_keep_cr(str); buf[i] = rb_str_new(0,0); rb_str_aset_m(argc+1, buf, str); } |