summaryrefslogtreecommitdiff
path: root/string.c
AgeCommit message (Collapse)Author
2011-05-09* string.c: Improve documentation for String#start_with? andnaruse
String#end_with?. fixes #4652 patched by Andrew Grimm <andrew.j.grimm at gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-24* string.c (rb_to_id): remove unused variable.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-20* string.c (rb_str_each_line): check string's length when comparenaruse
separator and string. [ruby-core:35815] fixes #4586 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07cancel subversion backfire. sorrymatz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07* gc.c (rb_gc_set_params): allow GC parameter configuration bymatz
environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07* string.c (tr_trans): suppress signedness/unsignedness warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-03* string.c (rb_str_slice_bang): raise error when the string is frozen.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-02* string.c (str_byte_substr): return nil for negative length.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-02* string.c (rb_str_slice_bang): move treatments which is only needednaruse
when the result is not nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-01* string.c (rb_str_byteslice): the resulted encoding should keepnaruse
original encoding. this also fixes the encoding when the result shares internal string. [ruby-core:35376] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-01Fix rdoc of String#byteslice. Feature #4447naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-01* string.c (rb_str_byteslice): Add String#byteslice. [ruby-core:35376]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-28* string.c (tr_trans): when the hash for multibyte repl is empty,naruse
tr is inverse mode, and a character doesn't much the table, the character should be replaced by last replacement. Bug #4449 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-15* string.c (rb_enc_cr_str_buf_cat): remove special treatment ofnaruse
ASCII-8BIT receivers. * string.c (str_gsub): set initial encoding of the buffer as the same of the receiver. [ruby-core:35141] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-06Ensure result encoding is the same as input encoding for String#gsub. [Bug ↵drbrain
#4340]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-04 * string.c (str_utf8_nth): fixed a conditon of optimized leadkosaki
byte counting. [Bug #4366][ruby-dev:43170] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-03 * string.c (count_utf8_lead_bytes_with_word): wrote functionkosaki
comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-30* string.c (rb_str_ellipsize): new function to ellipsize a string.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-26* include/ruby/ruby.h (ALLOCV): new API for exception-safenobu
temporary buffer. [ruby-core:34844] * string.c (rb_alloc_tmp_buffer, rb_free_tmp_buffer): implementation of the API. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-26* string.c (=~): documentation fix; the return value is nil whennaruse
it doesn't match. patched by Andrei Kulakov [ruby-core:34562] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-24* string.c (rb_str_resize): get rid of out-of-bound access.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-24* string.c (rb_string_value_cstr): rb_str_modify can changenobu
RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-22* string.c (str_nth_len, str_utf8_nth): return the rest length together.nobu
* string.c (rb_str_substr): get rid of measure the length always to improve performance for huge string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-08fix spaces.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-06* string.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05* string.c: fix rdoc typo.shyouhei
https://github.com/shyouhei/ruby/pull/3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-11* string.c (rb_str_inspect): fix: extra back slash is added whennaruse
the string is dummy encoding and includes \x22 or \x5C. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-01* string.c (rb_memhash): zero-filled strings should returnnobu
different values. [ruby-core:33500] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-01* string.c (rb_str_inspect): fix typo (not 0xFD but 0xFE).naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-30* string.c (rb_str_inspect): inspect as a dummy encoding stringnaruse
when a UTF-16/32 (not BE/LE) string does not have a BOM. Unicode and some RFCs say that a string labeld as UTF-16/32 doesn't have a BOM, it should be considered big endian. But many Windows programs generates little endian UTF-16 strings without a BOM. So String#inspect treats a string labeled UTF-16/32 withaout a BOM as a dummy encoding string. patched by Martin Duerst. [ruby-core:33461] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-24* string.c (rb_str_inspect): treat UTF-16 and UTF-32 as BE or LE.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-22* string.c (rb_str_inspect): fix for ascii-compatible externalnobu
encoding and different encoding string. [ruby-core:33283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-22* string.c (rb_str_inspect): append for each chars instead of bulknobu
copy if encoding conversion is needed. [ruby-core:33283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-22* string.c (rb_str_concat): set ENC_CODERANGE_VALID when thenaruse
receiver is 7BIT and the argument is non ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-03* string.c (rb_enc_cr_str_buf_cat): concatenation of validnobu
encoding string and invalid encoding string should result invalid encoding. [ruby-core:33027] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-28* string.c (rb_str_dump): fix expected length. [ruby-core:32935]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-24* array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu
transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c: replace calls to rb_error_frozen() with rb_check_frozen(). a patch from Run Paint Run Run at [ruby-core:32014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19Commit miss.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19* test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* numeric.c (rb_num_to_uint): added to check the range of arguments.naruse
Mainly for negative value with NUM2UINT on 32bit environment. * string.c (rb_str_concat): use rb_num_to_uint. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* string.c (rb_str_concat): use unsigned int for GB18030.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-24* string.c (sym_call), vm.c (invoke_block_from_c),nobu
vm_insnhelper.c (vm_yield_with_cfunc): pass given block. [ruby-core:32075] * vm_eval.c (rb_funcall_passing_block): new function to call method with passing given block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-24* string.c (rb_str_to_i): fix rdoc: String#to_i raises annaruse
exception when base is invalid. [ruby-core:31685] Fri Sep 24 15:28:35 2010 NARUSE, Yui <naruse@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-24* string.c (rb_str_rindex): use rb_enc_prev_char instead of repeated str_nth.naruse
patched by Michael Selig [ruby-core:32498] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-14* string.c (rb_str_times): mentioned about Hash argument. a patchnobu
from Daniel Bovensiepen at [ruby-core:32386]. * sprintf.c (get_hash): ditto, and fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-01* string.c (tr_setup_table): optimized. don't create hash objectsnaruse
when given pattern is ASCII only. * string.c (tr_find): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-30* string.c (tr_setup_table): fix bug in r29146.naruse
Initialize table even if cflag is 0; tr_find see whether del is empty or not. * string.c (tr_find): nodel can't be NULL; if NULL, it means it is not specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-30* string.c (tr_setup_table): initialize negating table whennaruse
negating string is given. [ruby-core:31851] * string.c (tr_find): add a sentence for the time when target characters include negating one. * string.c (rb_str_count): move definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-27 * string.c (rb_str_prepend): new method by Sora Harakamishyouhei
[Feature #3765] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-16Tue Aug 17 07:42:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>nobu
* string.c (str_make_independent_expand): set capacity properly. a patch from Peter Weldon at [ruby-core:31734]. [ruby-core:31653] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e