1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* string.c (rb_str_each_char): move forward. [ruby-dev:33231]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-01-21 02:59:02 +00:00
parent a8969e999a
commit 76e19bc534
2 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Mon Jan 21 11:59:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_each_char): move forward. [ruby-dev:33231]
Mon Jan 21 06:40:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* transcode.c (transcode_dispatch): constified return value.

View file

@ -3233,7 +3233,7 @@ rb_str_inspect(VALUE str)
char *s;
char *q;
escape_codepoint:
escape_codepoint:
for (q = p-n; q < p; q++) {
s = buf;
sprintf(buf, "\\x%02X", *q & 0377);
@ -4605,7 +4605,7 @@ rb_str_each_char(VALUE str)
len = RSTRING_LEN(str);
if ((i += n) >= len) break;
enc = rb_enc_get(str);
s = rb_enc_left_char_head(ptr, ptr + i, enc);
s = rb_enc_right_char_head(ptr, ptr + i, enc);
n = rb_enc_mbclen(s, ptr + len, enc);
}
return str;