зеркало из https://github.com/github/ruby.git
* string.c (rb_str_each_char): advance offset before get next char
length. [ruby-dev:33211] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
9007ae26a9
Коммит
ea64014c56
|
@ -1,3 +1,8 @@
|
|||
Mon Jan 21 03:45:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_each_char): advance offset before get next char
|
||||
length. [ruby-dev:33211]
|
||||
|
||||
Sun Jan 20 20:00:20 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||
|
||||
* transcode.c, enc/trans/utf_16_32.c, test/ruby/test_transcode.rb:
|
||||
|
|
3
string.c
3
string.c
|
@ -4599,10 +4599,11 @@ rb_str_each_char(VALUE str)
|
|||
len = RSTRING_LEN(str);
|
||||
enc = rb_enc_get(str);
|
||||
n = rb_enc_mbclen(ptr, ptr + len, enc);
|
||||
for (i = 0; i < len; i += n) {
|
||||
for (i = 0; i < len;) {
|
||||
rb_yield(rb_str_subseq(str, i, n));
|
||||
ptr = RSTRING_PTR(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);
|
||||
n = rb_enc_mbclen(s, ptr + len, enc);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#define RUBY_VERSION "1.9.0"
|
||||
#define RUBY_RELEASE_DATE "2008-01-19"
|
||||
#define RUBY_RELEASE_DATE "2008-01-21"
|
||||
#define RUBY_VERSION_CODE 190
|
||||
#define RUBY_RELEASE_CODE 20080119
|
||||
#define RUBY_RELEASE_CODE 20080121
|
||||
#define RUBY_PATCHLEVEL 0
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
|
@ -9,7 +9,7 @@
|
|||
#define RUBY_VERSION_TEENY 0
|
||||
#define RUBY_RELEASE_YEAR 2008
|
||||
#define RUBY_RELEASE_MONTH 1
|
||||
#define RUBY_RELEASE_DAY 19
|
||||
#define RUBY_RELEASE_DAY 21
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
|
|
Загрузка…
Ссылка в новой задаче