diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-31 04:16:01 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-31 04:16:01 +0000 |
commit | e741099a0a0d6fc05843fac4e31535294caf8b69 (patch) | |
tree | bf01a662f46bf6486c036872409eda7db025be99 /transcode.c | |
parent | 63634d77726beaa22d630b65a8acfa50c318b643 (diff) | |
download | ruby-e741099a0a0d6fc05843fac4e31535294caf8b69.tar.gz ruby-e741099a0a0d6fc05843fac4e31535294caf8b69.tar.xz ruby-e741099a0a0d6fc05843fac4e31535294caf8b69.zip |
* transcode.c (str_encode_bang): C99ism.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
-rw-r--r-- | transcode.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/transcode.c b/transcode.c index 9e4c8392c..418289392 100644 --- a/transcode.c +++ b/transcode.c @@ -2644,12 +2644,15 @@ str_encode_associate(VALUE str, int encidx) static VALUE str_encode_bang(int argc, VALUE *argv, VALUE str) { + VALUE newstr; + int encidx; + if (OBJ_FROZEN(str)) { /* in future, may use str_frozen_check from string.c, but that's currently static */ rb_raise(rb_eRuntimeError, "string frozen"); } - VALUE newstr = str; - int encidx = str_transcode(argc, argv, &newstr); + newstr = str; + encidx = str_transcode(argc, argv, &newstr); if (encidx < 0) return str; rb_str_shared_replace(str, newstr); |