summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-12-22 09:01:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-12-22 09:01:55 +0000
commit6d583574ab87c7cd18b66382c6892b545167bff6 (patch)
tree515b7c169ce2cd30fe085c5d861f5fad59aa76f7 /string.c
parente299d511db939232c628d6880e61c32e83937d66 (diff)
1.1d1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1dev@357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/string.c b/string.c
index a97319e5c7a..0f95a4cd2c8 100644
--- a/string.c
+++ b/string.c
@@ -60,14 +60,14 @@ rb_tainted_str_new(ptr, len)
char *ptr;
int len;
{
- return rb_str_new(ptr, len);
+ return rb_obj_taint(rb_str_new(ptr, len));
}
VALUE
rb_tainted_str_new2(ptr)
char *ptr;
{
- return rb_str_new2(ptr);
+ return rb_obj_taint(rb_str_new2(ptr));
}
VALUE
@@ -1095,7 +1095,7 @@ rb_str_gsub_bang(argc, argv, str)
else {
val = rb_reg_regsub(repl, str, regs);
}
- len = beg + RSTRING(val)->len + 3;
+ len = (bp - buf) + (beg - offset) + RSTRING(val)->len + 3;
if (blen < len) {
while (blen < len) blen *= 2;
len = bp - buf;