summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-25 07:14:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-25 07:14:01 +0000
commit10f56f8fd026456f02f65f270461faeadadf5386 (patch)
treeafc2e20e39da433c811aee2296759dcf740e8479 /string.c
parentc456863bd648a67eb57579f4e20b790ed6f7e304 (diff)
* string.c (rb_str_splice): return from void funtion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13268 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 d516d03438..3de977afe3 100644
--- a/string.c
+++ b/string.c
@@ -1889,7 +1889,7 @@ rb_str_splice(VALUE str, long beg, long len, VALUE val)
/* error check */
beg = p - RSTRING_PTR(str); /* physical position */
len = e - p; /* physical length */
- return rb_str_splice_0(str, beg, len, val);
+ rb_str_splice_0(str, beg, len, val);
}
void
@@ -2262,7 +2262,7 @@ str_gsub(int argc, VALUE *argv, VALUE str, int bang)
slen = RSTRING_LEN(str);
rb_str_locktmp(dest);
- while (beg >= 0) {
+ do {
n++;
match = rb_backref_get();
regs = RMATCH(match)->regs;
@@ -2309,7 +2309,7 @@ str_gsub(int argc, VALUE *argv, VALUE str, int bang)
cp = RSTRING_PTR(str) + offset;
if (offset > RSTRING_LEN(str)) break;
beg = rb_reg_search(pat, str, offset, 0);
- }
+ } while (beg >= 0);
if (RSTRING_LEN(str) > offset) {
len = bp - buf;
if (blen - len < RSTRING_LEN(str) - offset) {