aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
Commit message (Collapse)AuthorAgeFilesLines
* * string.c (rb_enc_cr_str_buf_cat): concatenation of validnobu2010-11-031-1/+4
| | | | | | | 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
* * string.c (rb_str_dump): fix expected length. [ruby-core:32935]nobu2010-10-281-5/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu2010-10-241-11/+3
| | | | | | | | 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
* Commit miss.nobu2010-10-191-3/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu2010-10-191-11/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (rb_num_to_uint): added to check the range of arguments.naruse2010-10-131-5/+10
| | | | | | | | 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
* * string.c (rb_str_concat): use unsigned int for GB18030.naruse2010-10-121-16/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (sym_call), vm.c (invoke_block_from_c),nobu2010-09-241-1/+3
| | | | | | | | | | 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
* * string.c (rb_str_to_i): fix rdoc: String#to_i raises annaruse2010-09-241-1/+1
| | | | | | | | 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
* * string.c (rb_str_rindex): use rb_enc_prev_char instead of repeated str_nth.naruse2010-09-241-3/+3
| | | | | | patched by Michael Selig [ruby-core:32498] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_times): mentioned about Hash argument. a patchnobu2010-09-141-3/+4
| | | | | | | | | | 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
* * string.c (tr_setup_table): optimized. don't create hash objectsnaruse2010-09-011-19/+21
| | | | | | | | 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
* * string.c (tr_setup_table): fix bug in r29146.naruse2010-08-301-5/+8
| | | | | | | | | | 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
* * string.c (tr_setup_table): initialize negating table whennaruse2010-08-301-9/+12
| | | | | | | | | | | 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
* * string.c (rb_str_prepend): new method by Sora Harakamishyouhei2010-08-271-0/+21
| | | | | | | [Feature #3765] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Tue Aug 17 07:42:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>nobu2010-08-161-5/+6
| | | | | | | * 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
* * configure.in, include/ruby/defines.h (RUBY_FUNC_EXPORTED): macronobu2010-08-141-1/+1
| | | | | | | | | | | 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
* * string.c (rb_str_set_len): bail out when buffer overflowednobu2010-08-051-0/+5
| | | | | | | probably. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_set_len): should fail to modify shared string.nobu2010-08-051-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_make_independent_expand): fix buffer overflownobu2010-08-051-1/+2
| | | | | | | while shrinking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_resize):: fix r28857 that failed to revert r28851.mame2010-08-041-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_resize): reverted r28851. rb_str_resize cannotnobu2010-08-041-1/+1
| | | | | | | 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
* * string.c (rb_str_set_len): rb_str_modify cannot work before thenobu2010-08-041-1/+1
| | | | | | | 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
* * string.c (rb_str_resize): should copy the content properly. anobu2010-08-041-1/+1
| | | | | | | 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
* * string.c (rb_str_modify_expand, rb_str_resize): get rid ofnobu2010-08-011-19/+38
| | | | | | repeating malloc and realloc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (RSTRING_GETMEM): new macro to get ptr andnobu2010-07-201-7/+13
| | | | | | | | 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
* * string.c (rb_str_conv_enc_opts): fix infinite loop becausenaruse2010-07-081-1/+1
| | | | | | | 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
* * string.c (NONASCII_MASK): NONASCII_MASK must be unsigned.mame2010-07-051-1/+1
| | | | | | [ruby-dev:41782] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_gsub_bang, rb_str_sub_bang, str_gsub): rdoc fixmarcandre2010-06-301-35/+53
| | | | | | 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
* * string.c (rb_str_buf_cat_escaped_char): get rid of buffernobu2010-06-061-2/+7
| | | | | | | 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
* * string.c (sym_inspect): Escape when the symbol is notnaruse2010-06-051-1/+3
| | | | | | | resulted encoding and not ascii_only. It had escaped ascii-incompatible string, but it is wrong. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_buf_cat_escaped_char): defined.naruse2010-06-051-22/+31
| | | | | | Splited from rb_str_inspect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): inspect as ASCII when the codepointnaruse2010-05-311-1/+4
| | | | | | of a character in Unicode string is ASCII printable one. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_replace_shared): change embedded state atomically.mame2010-05-291-1/+1
| | | | | | [ruby-core:29953] [ruby-dev:41456] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (sym_inspect): escape ASCII-compatible strings.nobu2010-05-281-8/+20
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): escape ASCII-compatible strings.nobu2010-05-281-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (proc_lambda, unnamed_parameters): Small documentation fixes.marcandre2010-05-171-1/+1
| | | | | | | | | | * re.c: ditto * string.c: ditto * time.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-163/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Harmonize documentation, in particular regarding:marcandre2010-05-131-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - methods returning enumerators - array methods and argument naming (array -> ary, an_array -> new_ary) - minor improvements, typo fixed and styling issues Other documentation errors fixed: - return value was self instead of a new array (or vice-versa) for Array#{pop,shift,permutation,repeated_permutation,keep_if} - Array#rindex was missing the form with a block. * dir.c: ditto. * enum.c: ditto. Modified Enumerable#reverse_each' documentation to clarify that #each will be finish before any element is yielded. * error.c: ditto. * gc.c: ditto. * hash.c: ditto. * io.c: ditto. IO#{codepoints,each_codepoint} fixed as per [ruby-core:23948] * numeric.c: ditto. * range.c: ditto. * string.c: ditto. * struct.c: ditto. * vm_eval.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_match_m): add description about optionalnaruse2010-05-061-2/+5
| | | | | | | position parameter. [ruby-list:47064] patched by KISHIMOTO, Makoto <ksmakoto AT dd.iij4u.or.jp> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_sub_bang): String#sub! now raises an error whenmarcandre2010-04-301-0/+1
| | | | | | | called on a frozen string, even if no change is made. See [ruby-core:23657] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (make_exception, rb_obj_extend): Fix error messages in case of wrongmarcandre2010-04-301-7/+7
| | | | | | | | | | | | | | | | | | | | | number of arguments * file.c (rb_f_test, rb_file_s_umask): ditto * numeric.c (int_chr, num_step): ditto * process.c (rb_f_sleep): ditto * re.c (rb_reg_initialize_m): ditto * signal.c (rb_f_kill, sig_trap): ditto * string.c (rb_str_aref_m, rb_str_aset_m, rb_str_count, rb_str_delete_bang, rb_str_slice_bang, rb_str_sub_bang, str_gsub): ditto * proc.c (curry): rdoc fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_string_value_cstr): make NUL terminated if it isnobu2010-04-141-1/+3
| | | | | | | not done. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_sum): use UCHAR_MAX.akr2010-03-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_sum): don't call method for each byte.akr2010-03-181-25/+33
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: Fix documentation for each/each_line/lines, bytes/each_byte,marcandre2010-03-071-54/+21
| | | | | | | | | | codepoints/each_code_point [ruby-core:23948] * string.c: ditto * ext/stringio/stringio.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_new_empty): String#split, partition, rpartitionmame2010-02-231-5/+13
| | | | | | taints the resulting strings if self is tainted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_push_m, rb_ary_unshift_m, rb_ary_aset),nobu2010-02-101-0/+1
| | | | | | | | | | | | | | (rb_ary_insert, rb_ary_replace, rb_ary_concat), (rb_ary_uniq_bang, rb_ary_flatten_bang): check if frozen after wrong number of arguments but before TypeError. [ruby-core:28140] * hash.c (rb_hash_replace): ditto. * string.c (rb_str_replace): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * fix the previous previous commit.mame2010-01-311-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_string_value): make no exception for Symbol.mame2010-01-311-7/+1
| | | | | | [ruby-dev:40274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e