From 287810940070b1c7b0cc915e6728da2f0aaac5e2 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 30 Apr 1998 07:41:23 +0000 Subject: new exception model git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'string.c') 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; { -- cgit v1.2.3