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:
parent
a8969e999a
commit
76e19bc534
2 changed files with 6 additions and 2 deletions
|
@ -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.
|
||||
|
|
4
string.c
4
string.c
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue