string passed to String#crypt contains null.
the patch is from jrusnack <jrusnack at redhat.com>.
[Bug #10988] [fix GH-853]
* test/ruby/test_string.rb: test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (str_buf_cat): expand later so that the buffer can be
larger for further use. [Bug #11080] [Bug #11080]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (str_buf_cat): expand the heap buffer at making
str independent, not only just copying.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_setbyte): check the argument first not to
discard shared string and code range unnecessarily until
actually changing the contents. pointed out by headius.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (STR_SET_SHARED): ignore FAKESTR because only Ruby objects
can use write barrier.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (chompped_length): enable smart chomp for all non-dummy
encoding strings, not only default_rs.
[ruby-core:68258] [Bug #10893]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (get_pat_quoted): simply raise a RegexpError, TypeError
is never raised.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_split_m): raise ArgumentError at broken string
not RegexpError, as Regexp is not involved in.
[ruby-core:68229] [Bug #10886]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_funcallv() for no arguments call instead of variadic
rb_funcall().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Bug #10853][ruby-core:68110]
* bootstraptest/test_string.rb: test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (str_buf_cat): use local variables instead of repeating
macros.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (str_make_independent_expand): terminate String when
moved from heap to embedded. [Fix GH-821].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_succ_bang): get rid of making intermediate
string object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_succ): extract local variables from constant
RSTRING_PTR and RSTRING_LEN.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_crypt): check arguments more strictly.
* crypt() is not for wide char strings
* salt bytes should not be NUL
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (chompped_length, chomp_rs): extract from
rb_str_chomp_bang to share with rb_str_chomp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (setup_fake_str): fake string does not share another
string, but just should not free.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/intern.h (SIZED_ENUMERATOR): separate from
RETURN_SIZED_ENUMERATOR.
* string.c (rb_str_enumerate_chars): get rid of calling
rb_block_given_p() twice.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_setter): preserve encoding of global variable
name in error message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_obj_equal() is specially optimized in
opt_eq_func()@vm_insnhelper.c.
This fix is made from this discussion:
https://www.omniref.com/ruby/2.1.4/symbols/Symbol/%3D%3D#line=8361.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (sym_printable): QUOTE() should not raise an exception
even on invalid byte sequence.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_{,l,r}strip_bang): rb_str_subseq() will not
NUL-terminate the result string, in the future, so it will not
be needed in other cases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e