summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-23 06:53:19 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-23 06:53:19 +0000
commitc384393dcb4b11f083f62071e2c098b7beeb4fd2 (patch)
treeba9d1eb2468dcc8cd82953070f6a3748b6eb58a2 /string.c
parent313f260ee254f0353a18dbc4733cdc436ee5fb18 (diff)
use to_io
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/string.c b/string.c
index 45c01c6899..f99ffced66 100644
--- a/string.c
+++ b/string.c
@@ -148,6 +148,8 @@ str_clone(orig)
str = str_new3(RSTRING(orig)->orig);
else
str = str_new(RSTRING(orig)->ptr, RSTRING(orig)->len);
+ if (RSTRING(orig)->orig && FL_TEST(orig, STR_NO_ORIG))
+ RSTRING(str)->orig = RSTRING(orig)->orig;
CLONESETUP(str, orig);
return str;
}
@@ -158,6 +160,8 @@ str_dup(str)
{
VALUE s = str_new(RSTRING(str)->ptr, RSTRING(str)->len);
if (str_tainted(str)) s = str_taint(s);
+ if (RSTRING(str)->orig && FL_TEST(str, STR_NO_ORIG))
+ RSTRING(s)->orig = RSTRING(str)->orig;
return s;
}