зеркало из https://github.com/github/ruby.git
* string.c (rb_str_succ): retry increasing until valid char is found.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5f2e5c07a7
Коммит
977eea57a3
|
@ -1,3 +1,7 @@
|
|||
Fri Dec 21 20:09:18 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_succ): retry increasing until valid char is found.
|
||||
|
||||
Fri Dec 21 20:00:02 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* encoding.c (rb_enc_replicate): now creates first class encoding.
|
||||
|
|
6
string.c
6
string.c
|
@ -1872,9 +1872,9 @@ rb_str_succ(VALUE orig)
|
|||
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 += 1;
|
||||
l = rb_enc_mbcput(cc, carry, enc);
|
||||
while ((l = rb_enc_mbcput(++cc, carry, enc)) < 0 && --limit);
|
||||
if (l > 0) {
|
||||
if (l == (o = e - s)) goto overlay;
|
||||
n = s - sbeg;
|
||||
|
@ -4538,7 +4538,7 @@ rb_str_chomp_bang(int argc, VALUE *argv, VALUE str)
|
|||
if (p[len-1] == newline &&
|
||||
(rslen <= 1 ||
|
||||
memcmp(RSTRING_PTR(rs), pp, rslen) == 0)) {
|
||||
if (ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,p,pp) != (const UChar*)pp)
|
||||
if (ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, (UChar *)p, (UChar *)pp) != (const UChar*)pp)
|
||||
return Qnil;
|
||||
rb_str_modify(str);
|
||||
STR_SET_LEN(str, RSTRING_LEN(str) - rslen);
|
||||
|
|
Загрузка…
Ссылка в новой задаче