aboutsummaryrefslogtreecommitdiffstats
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
parentc456863bd648a67eb57579f4e20b790ed6f7e304 (diff)
downloadruby-10f56f8fd026456f02f65f270461faeadadf5386.tar.gz
* 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
-rw-r--r--ChangeLog4
-rw-r--r--string.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1550c3a69f..51d5a31162 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,11 @@
-Sat Aug 25 16:06:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Aug 25 16:13:59 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (swallow): removed condition using an unset variable.
* parse.y, re.c: re-applied revision 13092.
+ * string.c (rb_str_splice): return from void funtion.
+
Sat Aug 25 11:45:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* encoding.c: provide basic features for M17N.
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) {