aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
Commit message (Collapse)AuthorAgeFilesLines
* * string.c (trnext): fix bug with string ending with '\\'.kazu2012-03-161-2/+2
| | | | | | | | | [ruby-dev:45374][Bug #6160] * test/ruby/test_string.rb (TestString#test_delete): test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (trnext): should advance char-wise.nobu2012-03-161-4/+4
| | | | | | [ruby-core:43335][Bug #6156] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_conv_enc_opts): default to original encoding.nobu2012-03-151-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre2012-03-141-25/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_aref): Improve rdoc, as per [bug #6106]marcandre2012-03-061-10/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/math.rb: remove description aboutnaruse2012-03-051-1/+1
| | | | | | | | BigMath#log. patched by Sho Hashimoto [ruby-dev:45307] [Bug #6112] * string.c (str_byteslice): fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Paranoia: /^/ -> /\A/ in regexp in rdoc. Pointed out by nobu.knu2012-02-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_crypt): Update rdoc and state that thisknu2012-02-271-6/+13
| | | | | | | | | function is system dependent. Reviewed by nobu, thanks to @takai. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_prepend): Fix documentation for String#prepend.ayumin2012-02-241-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_modify_expand): fix memory leak.nobu2012-02-081-4/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_concat): set array element after definitionngoto2012-01-111-1/+2
| | | | | | | | to fix compile error with Fujitsu C Compiler 5.6 on Solaris 10 on Sparc. [Bug #5878] [ruby-dev:45123] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (rb_enc_uint_char): raise RangeError when added codepointnaruse2012-01-081-9/+34
| | | | | | | | | | | | | | | | | is invalid. [Feature #5855] [Bug #5863] [Bug #5864] * string.c (rb_str_concat): ditto. * string.c (rb_str_concat): set encoding as ASCII-8BIT when the string is US-ASCII and the argument is an integer greater than 127. * regenc.c (onigenc_mb2_code_to_mbclen): rearrange error code. * enc/euc_jp.c (code_to_mbclen): ditto. * enc/shift_jis.c (code_to_mbclen): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_nth_len): count ascii-only run at the end. thisnobu2012-01-041-0/+1
| | | | | | | bug appears only when single-byte-optimization is disabled due to unknown coderange. [ruby-core:41896] [Bug #5836] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * whitespace cleanup.nobu2011-11-041-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-13/+13
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (tr_trans): free heap ptr when the str is not embeded.naruse2011-07-011-0/+3
| | | | | | patched by Eric Wong. [Bug #4956] [ruby-core:37708] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare internal functions here.akr2011-06-171-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: Fix the ambiguous description of the behavior ofmrkn2011-06-091-1/+2
| | | | | | | rb_str_aref_m with a range. It returns nil when the beginning of the range is greater than the end of the string rather than the range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Clarified String#tr rdoc. (RickHull)ryan2011-06-011-9/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_bytesize): rb_str_bytesize() should use LONG2NUM().kosaki2011-05-271-1/+1
| | | | | | | | Patch by Nikolai Weibull. [Bug #4789] [ruby-core:36511] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: Improve documentation for String#start_with? andnaruse2011-05-091-4/+4
| | | | | | | 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
* * string.c (rb_to_id): remove unused variable.kosaki2011-04-241-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_each_line): check string's length when comparenaruse2011-04-201-1/+2
| | | | | | 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
* cancel subversion backfire. sorrymatz2011-03-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_set_params): allow GC parameter configuration bymatz2011-03-071-1/+1
| | | | | | | 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
* * string.c (tr_trans): suppress signedness/unsignedness warnings.nobu2011-03-071-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_slice_bang): raise error when the string is frozen.naruse2011-03-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_byte_substr): return nil for negative length.nobu2011-03-021-27/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_slice_bang): move treatments which is only needednaruse2011-03-021-4/+4
| | | | | | when the result is not nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_byteslice): the resulted encoding should keepnaruse2011-03-011-5/+4
| | | | | | | 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
* Fix rdoc of String#byteslice. Feature #4447naruse2011-03-011-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_byteslice): Add String#byteslice. [ruby-core:35376]naruse2011-03-011-0/+103
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (tr_trans): when the hash for multibyte repl is empty,naruse2011-02-281-1/+1
| | | | | | | 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
* * string.c (rb_enc_cr_str_buf_cat): remove special treatment ofnaruse2011-02-151-3/+3
| | | | | | | | | 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
* Ensure result encoding is the same as input encoding for String#gsub. [Bug ↵drbrain2011-02-061-0/+1
| | | | | | #4340]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_utf8_nth): fixed a conditon of optimized leadkosaki2011-02-041-1/+1
| | | | | | | | byte counting. [Bug #4366][ruby-dev:43170] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (count_utf8_lead_bytes_with_word): wrote functionkosaki2011-02-031-0/+17
| | | | | | | | comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_ellipsize): new function to ellipsize a string.nobu2011-01-301-0/+51
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (ALLOCV): new API for exception-safenobu2011-01-261-0/+18
| | | | | | | | 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
* * string.c (=~): documentation fix; the return value is nil whennaruse2011-01-261-1/+1
| | | | | | 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
* * string.c (rb_str_resize): get rid of out-of-bound access.nobu2011-01-241-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_string_value_cstr): rb_str_modify can changenobu2011-01-241-1/+5
| | | | | | RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_nth_len, str_utf8_nth): return the rest length together.nobu2011-01-221-14/+32
| | | | | | | * 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
* fix spaces.akr2011-01-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: parenthesize macro arguments.akr2011-01-061-15/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: fix rdoc typo.shyouhei2011-01-051-2/+0
| | | | | | | https://github.com/shyouhei/ruby/pull/3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): fix: extra back slash is added whennaruse2010-12-111-2/+3
| | | | | | 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
* * string.c (rb_memhash): zero-filled strings should returnnobu2010-12-011-1/+1
| | | | | | different values. [ruby-core:33500] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): fix typo (not 0xFD but 0xFE).naruse2010-12-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): inspect as a dummy encoding stringnaruse2010-11-301-4/+14
| | | | | | | | | | | | 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