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

merges r31310 from trunk into ruby_1_9_2.

--
* string.c (rb_str_each_line): check string's length when compare
  separator and string. [ruby-core:35815] fixes #4586

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2011-05-30 04:43:29 +00:00
parent ac899ff9c8
commit 69e5d34b40
3 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Wed Apr 20 14:41:28 2011 NARUSE, Yui <naruse@ruby-lang.org>
* string.c (rb_str_each_line): check string's length when compare
separator and string. [ruby-core:35815] fixes #4586
Mon Apr 18 12:15:46 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_range.rb (TestRange#test_step_ruby_core_35753):

View file

@ -5828,7 +5828,8 @@ rb_str_each_line(int argc, VALUE *argv, VALUE str)
p -= n;
}
if (c == newline &&
(rslen <= 1 || memcmp(RSTRING_PTR(rs), p, rslen) == 0)) {
(rslen <= 1 ||
(pend - p >= rslen && memcmp(RSTRING_PTR(rs), p, rslen) == 0))) {
line = rb_str_new5(str, s, p - s + (rslen ? rslen : n));
OBJ_INFECT(line, str);
rb_enc_cr_str_copy_for_substr(line, str);

View file

@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
#define RUBY_PATCHLEVEL 233
#define RUBY_PATCHLEVEL 234
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1