summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-04-10 06:09:00 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-04-10 06:09:00 +0000
commit1c907a93001b65cebfb5229dea11ce60289fd14e (patch)
tree05852fad6a378aa3c04243244f793964ccb42d7f /io.c
parent3a0384f498d4568f1a1f200633852d9fa9f8b382 (diff)
* io.c (opt_i_set): should strdup() inplace_edit string.
* eval.c (exec_under): need to push cref too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io.c b/io.c
index bd1790dacd..6e1c932d5d 100644
--- a/io.c
+++ b/io.c
@@ -3324,11 +3324,12 @@ static void
opt_i_set(val)
VALUE val;
{
+ if (ruby_inplace_mode) free(ruby_inplace_mode);
if (!RTEST(val)) {
ruby_inplace_mode = 0;
return;
}
- ruby_inplace_mode = STR2CSTR(val);
+ ruby_inplace_mode = strdup(STR2CSTR(val));
}
void