summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-23 02:58:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-23 02:58:48 +0000
commiteae1366b3867fe304b54c2adcc87fdd583990077 (patch)
treee610e1eb7cffa02fdaf57cc3e2b8cd838f99931c /string.c
parent0a13d383be19c7feb57989e431744a937be832a0 (diff)
string.c: suppress warnings
* string.c (rb_str_scrub): suppress maybe-uninitialized and empty body in an else-statement. [ruby-dev:45975] [Feature #6752] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/string.c b/string.c
index ce9cce03d1..7bb4d5bd90 100644
--- a/string.c
+++ b/string.c
@@ -7815,6 +7815,8 @@ rb_str_scrub(int argc, VALUE *argv, VALUE str)
VALUE buf = rb_str_buf_new(RSTRING_LEN(str));
if (rb_block_given_p()) {
rep = NULL;
+ replen = 0;
+ rep7bit_p = FALSE;
}
else if (!NIL_P(repl)) {
rep = RSTRING_PTR(repl);
@@ -7866,8 +7868,8 @@ rb_str_scrub(int argc, VALUE *argv, VALUE str)
for (; clen > 1; clen--) {
ret = rb_enc_precise_mbclen(q, q + clen, enc);
if (MBCLEN_NEEDMORE_P(ret)) break;
- else if (MBCLEN_INVALID_P(ret)) continue;
- else UNREACHABLE;
+ if (MBCLEN_INVALID_P(ret)) continue;
+ UNREACHABLE;
}
}
if (rep) {
@@ -7978,8 +7980,8 @@ rb_str_scrub(int argc, VALUE *argv, VALUE str)
for (; clen > mbminlen; clen-=mbminlen) {
ret = rb_enc_precise_mbclen(q, q + clen, enc);
if (MBCLEN_NEEDMORE_P(ret)) break;
- else if (MBCLEN_INVALID_P(ret)) continue;
- else UNREACHABLE;
+ if (MBCLEN_INVALID_P(ret)) continue;
+ UNREACHABLE;
}
}
if (rep) {