summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-31 04:16:01 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-31 04:16:01 +0000
commita436212282330a6b132e0a4174178a4ca253dea0 (patch)
treebf01a662f46bf6486c036872409eda7db025be99
parente5df8fd261824a4ed6fc65a5a846b8b7a37ee3c3 (diff)
* transcode.c (str_encode_bang): C99ism.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--transcode.c7
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1d5ae228ade..3a1bf6c4698 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Jul 31 13:15:27 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * transcode.c (str_encode_bang): C99ism.
+
Fri Jul 31 11:48:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* compile.c (iseq_compile_each): used more appropriate construct.
diff --git a/transcode.c b/transcode.c
index 9e4c8392c6f..4182893928e 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);