summaryrefslogtreecommitdiff
path: root/string.c
AgeCommit message (Collapse)Author
2008-05-20* string.c (rb_usascii_str_new): use rb_str_new.naruse
* string.c (rb_enc_str_new): ditto. * string.c (rb_usascii_str_new2): use rb_str_new2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-20* string.c (rb_enc_strlen_cr): need to set ENC_CODERANGE_7BIT ifmatz
search_nonascii() fails. [ruby-dev:34751] * string.c (rb_str_reverse): preserve coderange info if the receiver is 7bit string. * string.c (rb_str_reverse_bang): ditto. * string.c (rb_str_reverse_bang): should have called single_byte_optimizable before rb_str_modify() that clears coderange info. * string.c (tr_trans): handle single bytes more eagerly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-19* regparse.c (PINC): use optimized enclen() instead ofmatz
ONIGENC_MBC_ENC_LEN(). * regparse.c (PFETCH): ditto. * regparse.c (PFETCH): small optimization. * regexec.c (slow_search): single byte encoding optimization. * regenc.h (enclen): avoid calling function when encoding's min_len == max_len. * re.c (rb_reg_regsub): rb_enc_ascget() optimization for single byte encoding. * re.c (rb_reg_search): avoid allocating new re_registers if we already have MatchData. * re.c (match_init_copy): avoid unnecessary onig_region_free() before onig_region_copy. * encoding.c (rb_enc_get_index): remove implicit enc_capable check each time. * encoding.c (rb_enc_set_index): ditto. * encoding.c (enc_compatible_p): small refactoring. * include/ruby/encoding.h (rb_enc_dummy_p): inline rb_enc_dummy_p() and export related code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-15* string.c (tr_find): String#delete returned wrong result when multiplemame
utf-8 arguments are passed. * test/ruby/test_m17n.rb (test_delete): add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-13* string.c (rb_str_cat): fixed buffer overrun reported bymatz
Christopher Thompson <cthompson at nexopia.com> in [ruby-core:16746] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12* string.c (sym_to_i): really removed. [ruby-dev:34641]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-10* string.c (tr_trans): should not turn on modify flag if nomatz
modification happens. [ruby-dev:34631] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-10* string.c (tr_trans): should check src size, not str size.matz
[ruby-dev:34637] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-10* string.c (tr_trans): single '^' does not mean negation.matz
[ruby-dev:34632] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-10* string.c (rb_str_each_line): zero length record separator shouldmatz
split a string into paragraphs. [ruby-dev:34586] * string.c (rb_str_each_line): RDoc updated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07* thread.c (rb_thread_key_p): thread local storage stores ID.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07* string.c (tr_trans): should squeeze properly. [ruby-dev:34587]matz
* string.c (tr_trans): had a bug in treating multi-byte character replacement. * string.c (rb_str_delete_bang): need not to do anything for empty strings. * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_delete): add test for empty receiver. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-04* string.c (rb_str_each_line): return original string.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22* string.c (rb_enc_cr_str_buf_cat): do not use C++ comment.shyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-06* string.c (rb_str_intern): need not to check if tainted.matz
[ruby-dev:34219] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-17* re.c (rb_memsearch_ss): simple shift search.naruse
* re.c (rb_memsearch_qs): quick search. * re.c (rb_memsearch_qs_utf8): quick search for UTF-8 string. * re.c (rb_memsearch_qs_utf8_hash): hash functions for above. * re.c (rb_memsearch): use above functions. * string.c (rb_str_index): give enc to rb_memsearch. * include/ruby/intern.h (rb_memsearch): move to encoding.h. * include/ruby/encoding.h (rb_memsearch): move from intern.h. * common.mk (PREP): add dependency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-15* encoding.c (rb_enc_associate_index): pass unnecessary enc_capable().matz
* string.c (rb_str_cmp): reduce invocation of rb_enc_compatible(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-14* include/ruby/ruby.h (inttypes.h): includes always if available.nobu
* string.c, ext/digest/defs.h: moved inttypes.h to ruby.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-14* string.c (UNALIGNED_WORD_ACCESS): IA64 cannot access unaligned word.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-13* trunk/configure.in (AC_CHECK_HEADERS): stdint.h is not needed to check.nobu
* trunk/configure.in (rb_cv_type_uint32_t): unqouted. [ruby-dev:34030] * trunk/string.c (hash): use inttypes.h instead of stdint.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-12* configure.in (stdint.h): check if presence.nobu
* configure.in (uint32_t): check if defined. * string.c (hash): fix for portability. [ruby-dev:34020] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-11* string.c (hash): replaced by MurmurHash described inmatz
<http://murmurhash.googlepages.com/>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-11* string.c (rb_str_comparable): empty strings in any encoding arematz
compatible each other. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-09* string.c (rb_str_index): if t == s + pos, the character beginningnaruse
from s + pos is valid. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-09fix doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-08* string.c (search_nonascii): Use VALUE instead of unsigned longnaruse
because VALUE can be the fastest unsigned integer type. On LLP64 unsigned long isn't the fastest. * string.c (str_strlen): ditto. * string.c (str_utf8_nth): ditto. * string.c (count_utf8_lead_bytes_with_ulong): ditto. * string.c (count_utf8_lead_bytes_with_word): renamed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-05* string.c (count_utf8_lead_bytes_with_ulong): fix shift size.naruse
[ruby-dev:33993] * string.c (str_utf8_nth) fix wrong counting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-05* string.c (is_utf8_lead_byte, count_utf8_lead_bytes_with_ulong):naruse
defined for UTF-8 optimization. * string.c (str_strlen): use is_utf8_lead_byte and count_utf8_lead_bytes_with_ulong. * string.c (str_utf8_nth) ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-05* numeric.c (fix_to_s): avoid rb_scan_args() when no argumentmatz
given. * bignum.c (rb_big_to_s): ditto. * enum.c (enum_first): ditto. * eval_jump.c (rb_f_catch): ditto. * io.c (rb_obj_display): ditto. * class.c (rb_obj_singleton_methods): ditto. * object.c (rb_class_initialize): ditto. * random.c (rb_f_srand): ditto. * range.c (range_step): ditto. * re.c (rb_reg_s_last_match): ditto. * string.c (rb_str_to_i): ditto. * string.c (rb_str_each_line): ditto. * string.c (rb_str_chomp_bang): ditto. * string.c (rb_str_sum): ditto. * string.c (str_modifiable): declare inline. * string.c (str_independent): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01* string.c (sym_inspect): use rb_str_inspect() instead ofmatz
rb_str_dump(). [ruby-dev:33946] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01* string.c (tr_setup_table, rb_str_split_m, rb_str_chomp_bang):nobu
simplified with rb_enc_ascget(). [ruby-dev:33944] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01* string.c (rb_str_coderange_scan_restartable): should not returnmatz
offset in the middle of a character. * string.c (rb_str_coderange_scan_restartable): should not return invalid cr value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29* test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_chomp): testmatz
updated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29* string.c (rb_str_chomp_bang): now works on UTF-16.matz
* string.c (tr_setup_table): negation should work on non ASCII compatible strings as well. * string.c (rb_str_split_m): awk split should work on non ASCII compatible strings as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29* time.c (time_strftime): format should be ascii compatible.matz
* parse.y (rb_intern3): non ASCII compatible symbols. * re.c (rb_reg_regsub): add encoding check. * string.c (rb_str_chomp_bang): ditto. * test/ruby/test_utf16.rb (TestUTF16::test_chomp): raises exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29* string.c (rb_str_rpartition): calculation was done in byte indexing.matz
* test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_start_with): allow start_with? matching on broken strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-28* string.c (str_new): remove encoding assumption of empty string.naruse
* hash.c ( rb_f_getenv, env_fetch, env_inspect): result of ENV should be always ASCII-8BIT. * object.c (nil_to_s): nil.to_s should be US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-28* string.c (rb_enc_str_copy): removed.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-28* string.c (rb_str_reverse_bang): removed unsed variables.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-28* include/ruby/encoding.h (rb_str_coderange_scan_restartable): addednobu
prototype. * string.c (rb_str_coderange_scan_restartable, rb_str_times): removed unsed variables. * string.c (rb_enc_str_copy): unused now. may be used in future? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-27* string.c (rb_str_coderange_scan_restartable): coderange scaningnaruse
for partial read. * io.c (read_all): set coderange when not convert encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-23* string.c (str_sublen): removed.naruse
* string.c (rb_str_reverse, rb_str_reverse_bang): use single_byte_optimizable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-23* string.c (rb_enc_cr_str_copy_for_substr): renamed fromnaruse
rb_enc_cr_str_copy. * string.c: use rb_enc_cr_str_copy_for_substr and keep coderange. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-22* fix missing STR_ENC_GET.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-22* add ascii incompatible case.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-22* string.c (rb_enc_cr_str_copy): check string's coderange is 7bit ornaruse
valid. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-22* encoding.c (rb_enc_mbclen): return minlen instead of 1 whenakr
a character is not found properly. * string.c (rb_enc_strlen): round up string length with fixed multibyte encoding such as UTF-32. (rb_enc_strlen_cr): ditto. (rb_str_substr): fix substring with fixed multibyte encoding. (rb_str_justify): check number of characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-22* string.c (rb_str_inspect): string of ascii incompatible encodingnaruse
should be escaped and returned as US-ASCII encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-22* string.c (rb_str_substr): copy encoding although empty string.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-21* string.c (rb_str_times): empty string's coderange is CODERANGE_7BIT.naruse
* string.c (rb_str_substr): ditto. * encoding.c (rb_enc_compatible): empty string is compatible with not only nonasciicompatible strings. [ruby-dev:33895] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e