(rb_str_start_with, rb_str_end_with): preserve the last match
data. [ruby-core:39671] [Bug #5351]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@33527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
the mistake of calculation. reported by eban via IRC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c, bignum.c, dir.c, enumerator.c, gc.c, io.c, numeric.c,
object.c, re.c, string.c, struct.c: Mixing two styles is not a
good thing. Stick with the K&R style in 1.8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (Hash#try_convert): New method backported from 1.9.
* io.c (IO#try_convert): New method backported from 1.9.
* re.c (Regexp#try_convert): New method backported from 1.9.
* string.c (String#try_convert): New method backported from 1.9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
C. Mitchell AT gmail.com> at [ruby-talk:321967]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
and String#setbyte for the forward compatibility with 1.9, where
the behavior of String#[] and String#[]= have changed; based on
a patch from Shinichiro Hamaji in [ruby-dev:37247].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_string_value so that extension libraries do not segfault.
[ruby-core:19971]
* string.c (rb_str_replace): reduced unnecessary malloc and copy.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
non-alphanumeric characters can carry up. e.g., "1.999".succ should
be "2.000".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_ary_aplice, rb_ary_times): integer overflows should be
checked. based on patches from Drew Yao <ayao at apple.com>
fixed CVE-2008-2726
* string.c (rb_str_buf_append): fixed unsafe use of alloca,
which led memory corruption. based on a patch from Drew Yao
<ayao at apple.com> fixed CVE-2008-2726
* sprintf.c (rb_str_format): backported from trunk.
* intern.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
value is specified as step. [rubyspec]
(range_step): Make use of String#step internally if a string (or
string-alike) range is given.
* string.c (rb_str_upto_m, Init_String): Add an optional second
argument to specify if the last value should be included.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Christopher Thompson <cthompson at nexopia.com> in [ruby-core:16746]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
enumerator integration. #lines and #bytes are now aliases to
#each_line and #each_byte, respectively.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_str_start_with, rb_str_end_with): New methods:
String#partition, #rpartition, #start_with? and #end_with?;
backported from 1.9. These methods are $KCODE aware unlike
#index, #rindex and #include?.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
with #to_str method, as well as rb_str_index_m. [ruby-core:11692]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
before actually modifying the string.
fixed: [ruby-dev:30211] (originally reported by zunda)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e