summaryrefslogtreecommitdiff
path: root/string.c
AgeCommit message (Collapse)Author
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
2010-08-14* configure.in, include/ruby/defines.h (RUBY_FUNC_EXPORTED): macronobu
to declare exported function. * array.c (rb_ary_memsize), string.c (rb_str_memsize), variable.c (rb_objspace_data_type_memsize): used in objspace. [ruby-dev:42022] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-05* string.c (rb_str_set_len): bail out when buffer overflowednobu
probably. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-05* string.c (rb_str_set_len): should fail to modify shared string.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-05* string.c (str_make_independent_expand): fix buffer overflownobu
while shrinking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-04* string.c (rb_str_resize):: fix r28857 that failed to revert r28851.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-04 * string.c (rb_str_resize): reverted r28851. rb_str_resize cannotnobu
work before the length is set. [ruby-core:31615] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-04* string.c (rb_str_set_len): rb_str_modify cannot work before thenobu
length is set, which is a precondition for rb_str_modify. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-04* string.c (rb_str_resize): should copy the content properly. anobu
patch from Jeremy Evans at [ruby-core:31615]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-01* string.c (rb_str_modify_expand, rb_str_resize): get rid ofnobu
repeating malloc and realloc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-20* include/ruby/ruby.h (RSTRING_GETMEM): new macro to get ptr andnobu
len at once. * string.c (rb_str_cmp, str_eql, rb_str_eql): trivial improvements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-08* string.c (rb_str_conv_enc_opts): fix infinite loop becausenaruse
of ISO-2022-JP conversion with empty string. patched by Brian Buchanan [ruby-core:31107] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-05* string.c (NONASCII_MASK): NONASCII_MASK must be unsigned.mame
[ruby-dev:41782] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-30* string.c (rb_str_gsub_bang, rb_str_sub_bang, str_gsub): rdoc fixmarcandre
based on patch by Run Paint [ruby-core:30938] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-06* string.c (rb_str_buf_cat_escaped_char): get rid of buffernobu
overflow on platforms int is bigger than 32bit, and warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e