summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-10 04:40:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-10 04:40:40 +0000
commit397ee1a31500368f9e06b47ec5da3ca9054bd751 (patch)
tree3324905a8f40d34fd81696394704112b645fe805 /string.c
parent5007c3461953e6ead84e69863b435c3c60e15bdb (diff)
* eval.c (rb_thread_select), string.c (str_gsub): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index 5f1414ac34..45bfe18fc7 100644
--- a/string.c
+++ b/string.c
@@ -2140,7 +2140,7 @@ str_gsub(argc, argv, str, bang)
slen = RSTRING(str)->len;
rb_str_locktmp(dest);
- while (beg >= 0) {
+ do {
n++;
match = rb_backref_get();
regs = RMATCH(match)->regs;
@@ -2187,7 +2187,7 @@ str_gsub(argc, argv, str, bang)
cp = RSTRING(str)->ptr + offset;
if (offset > RSTRING(str)->len) break;
beg = rb_reg_search(pat, str, offset, 0);
- }
+ } while (beg >= 0);
if (RSTRING(str)->len > offset) {
len = bp - buf;
if (blen - len < RSTRING(str)->len - offset) {