summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-30 07:41:23 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-30 07:41:23 +0000
commit287810940070b1c7b0cc915e6728da2f0aaac5e2 (patch)
treefd7394d6274c72eb3a15a179c627143bf8fb707f /string.c
parentb6e85a5e29a9790ec33add32bb554b55e3ad4ba9 (diff)
new exception model
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/string.c b/string.c
index 83169f4192..cedf53acee 100644
--- a/string.c
+++ b/string.c
@@ -171,7 +171,10 @@ VALUE
str_dup(str)
VALUE str;
{
- VALUE s = str_new(RSTRING(str)->ptr, RSTRING(str)->len);
+ VALUE s;
+
+ str = to_str(str);
+ 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;
@@ -442,7 +445,7 @@ str_cat(str, ptr, len)
return str;
}
-static VALUE
+VALUE
str_concat(str1, str2)
VALUE str1, str2;
{