summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-25 06:55:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-25 06:55:16 +0000
commite52df767933955850eb95d7e039d46e24e18dbc4 (patch)
tree04e2fe3dd2d2fb09369e59b151b2769244f18184 /string.c
parentc8d3cae421b6ff37f030d362db8f48561daba545 (diff)
downloadruby-e52df767933955850eb95d7e039d46e24e18dbc4.tar.gz
ruby-e52df767933955850eb95d7e039d46e24e18dbc4.tar.xz
ruby-e52df767933955850eb95d7e039d46e24e18dbc4.zip
* string.c (rb_str_succ): fix for string with non-alphanumeric chars.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/string.c b/string.c
index 6ca4ba3c6..7c49b3463 100644
--- a/string.c
+++ b/string.c
@@ -1886,16 +1886,13 @@ rb_str_succ(VALUE orig)
}
n = s - sbeg;
}
- else {
- break;
- }
}
if (c == -1) { /* str contains no alnum */
c = '\001';
s = e;
while ((s = rb_enc_prev_char(sbeg, s, enc)) != 0) {
int limit = 256;
- if (cc == 0) cc = rb_enc_codepoint(s, e, enc);
+ cc = rb_enc_codepoint(s, e, enc);
while ((l = rb_enc_mbcput(++cc, carry, enc)) < 0 && --limit);
if (l > 0) {
if (l == (o = e - s)) goto overlay;