summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/string.c b/string.c
index 7b8c558c11..ee22f202e4 100644
--- a/string.c
+++ b/string.c
@@ -128,7 +128,7 @@ rb_str_to_str(str)
}
static void
-rb_str_assign(str, str2)
+rb_str_become(str, str2)
VALUE str, str2;
{
if (str == str2) return;
@@ -422,7 +422,9 @@ rb_str_concat(str1, str2)
}
}
if (TYPE(str2) != T_STRING) str2 = rb_str_to_str(str2);
- return rb_str_cat(str1, RSTRING(str2)->ptr, RSTRING(str2)->len);
+ str1 = rb_str_cat(str1, RSTRING(str2)->ptr, RSTRING(str2)->len);
+ if (OBJ_TAINTED(str2)) OBJ_TAINT(str1);
+ return str1;
}
int
@@ -746,7 +748,7 @@ rb_str_succ_bang(str)
VALUE str;
{
rb_str_modify(str);
- rb_str_assign(str, rb_str_succ(str));
+ rb_str_become(str, rb_str_succ(str));
return str;
}