mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_str_succ): fix for string with non-alphanumeric chars.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
72bf77fb30
commit
f1fc4bbecb
2 changed files with 5 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Dec 25 15:55:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_succ): fix for string with non-alphanumeric chars.
|
||||
|
||||
Tue Dec 25 15:42:49 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* io.c (rb_io_external_encoding): should return nil for
|
||||
|
|
5
string.c
5
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;
|
||||
|
|
Loading…
Reference in a new issue