aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
Commit message (Collapse)AuthorAgeFilesLines
* * 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
* * string.c (rb_str_inspect): suppress a warning.nobu2010-01-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): increment by rb_enc_mbminlen(enc) forakr2010-01-241-3/+8
| | | | | | | broken byte sequence. [ruby-core:27748] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_enc_strlen_cr): increment by rb_enc_mbminlen(enc) forakr2010-01-241-1/+4
| | | | | | | broken byte sequence. [ruby-core:27748] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_concat): fixed range check for Fixnum, andnobu2010-01-141-3/+14
| | | | | | | added checks for integer overflow and invalid char code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_concat): raise RangeError when the argument isnaruse2010-01-141-2/+12
| | | | | | negative value. [ruby-core:27583] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_set_len): call rb_str_modify.akr2010-01-121-0/+1
| | | | | | | | * file.c (realpath_rec): don't call rb_str_modify before rb_str_set_len. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_strlen): added. [ruby-dev:40028]naruse2010-01-111-0/+6
| | | | | | * include/ruby/intern.h (rb_str_strlen): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): CHAR_ESC_LEN should be 13.naruse2009-12-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_justify): fixed the case a fill size is anobu2009-12-091-2/+2
| | | | | | | multiple of the length of the padding. [ruby-dev:39856] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_justify): CVE-2009-4124.yugui2009-12-071-28/+33
| | | | | | | | | Fixes a bug reported by Emmanouel Kellinis <Emmanouel.Kellinis AT kpmg.co.uk>, KPMG London; Patch by nobu. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed spaces just before tabs.nobu2009-11-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_utf8_nth): no count_utf8_lead_bytes_with_wordnobu2009-11-181-3/+1
| | | | | | | | | | optimization for short string. [ruby-core:26787] * string.c (str_utf8_offset): str_utf8_nth never return NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_utf8_nth): fixed overrun. [ruby-core:26787]nobu2009-11-171-0/+1
| | | | | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_each_line): rdoc fixmarcandre2009-11-091-3/+3
| | | | | | * ext/bigdecimal/bigdecimal.c (#infinite?, #nonzero?): rdoc fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * random.c (rb_hash_start): moved from string.c.nobu2009-11-031-26/+0
| | | | | | | | | * random.c (Init_RandomSeed2): register global address before set. * random.c (Init_RandomSeed): initialize hashseed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upto): make next object before yield its block.naruse2009-11-031-3/+6
| | | | | | | fix: can modify original begin string of String#upto. [ruby-dev:26384] [ruby-dev:39626] #2327 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (trnext): detect empty range and raise exception.matz2009-10-301-1/+11
| | | | | | [ruby-dev:39108] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_sub_bang): trivial optimization.nobu2009-10-291-14/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: rdoc for <=>, casecmpmarcandre2009-10-281-4/+4
| | | | | | | | | | | | * bignum.c: rdoc for <=> * file.c: ditto * time.c: ditto * compar.c: rdoc git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (chopped_length): get rid of unexpected exception.nobu2009-10-271-2/+2
| | | | | | | see [ruby-core:26336]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo.akr2009-10-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_intern3): check symbol table overflow.nobu2009-10-151-17/+2
| | | | | | | [ruby-core:26092] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_check_string_type): rdoc fix [ruby-core:26084]marcandre2009-10-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): copy by chunks.nobu2009-10-071-29/+32
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): don't assign -1 to unsigned int.naruse2009-10-071-19/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upto): RDoc updated. a patch from Nobuhiromatz2009-10-061-0/+8
| | | | | | IMAI <nov at yo.rim.or.jp> in [ruby-dev:39440]. [ruby-dev:39439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_{times, shuffle_bang, sample}): reducing macromatz2009-10-051-11/+16
| | | | | | | | | | | | | calls inside of the loop by keeping pointers in local variables. a patch from Masahiro Kanai (CanI) in [ruby-dev:39406]. It was found and fixed at Security and Programming camp 2009. * string.c (rb_str_{times, split_m}): ditto. * struct.c (rb_struct_{getmember, set, aref_id, aset_id}, {make, inspect}_struct, recursive_{equal, hash, eql}): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Escape as \x{XXXX} other than Unicode chars.naruse2009-09-291-8/+17
| | | | | | | * string.c (rb_str_inspect): escape as \x{XXXX} when the encoding is other than Unicode. [ruby-dev:39388] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): dump as \uXXXX when thenaruse2009-09-291-9/+21
| | | | | | string is in Unicode. [ruby-dev:39388] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_f_getenv): use rb_filesystem_str_new_cstrnaruse2009-09-281-0/+12
| | | | | | | | | | | | | | | | | | | instead of rb_str_new2. ENV['PATH'].encoding should be Filesystem Encoding because its content is related to filesystem. see [ruby-dev:39393] * hash.c (env_fetch): ditto. * string.c (rb_filesystem_str_new): defined. * string.c (rb_filesystem_str_new_cstr): ditto. * include/ruby/intern.h (rb_filesystem_str_new): added. * include/ruby/intern.h (rb_filesystem_str_new_cstr): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_buf_cat2): optimize since all second arguments arenobu2009-09-271-5/+3
| | | | | | | | | constant literals. * string.c (str_cat_char): unused now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_hash_{uint{32,},end}): removed.nobu2009-09-271-8/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* String#inspect's encoding should be fixed.naruse2009-09-261-31/+31
| | | | | | | | | | | | | | | | * string.c (rb_str_inspect): result's encoding should be fixed. If default_internal is not nil, the encoding is default_internal. Else if default_external is not nil, the encoding is default_external. But the encoding is not ASCII-compatible, the encoding is replaced by US-ASCII. Characters in ASCII-incompatible encoding or non ASCII characters in other than the encoding will be \xXX escaped. * string.c (str_buf_cat2): defined. * string.c (prefix_escape): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: use rename-macro instead of RUBY_ALIAS_FUNCTION_TYPE.ko12009-09-261-9/+4
| | | | | | | | Because build causes failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: moved murmur hash from string.c. [ruby-dev:39376]nobu2009-09-261-241/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (hash): updated to MurmurHash 2.0 2009-09-19.nobu2009-09-261-69/+88
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_hash_start): fixed shift width on 128bit platform.nobu2009-09-261-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upto): keep first width. [ruby-dev:39361]nobu2009-09-231-4/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: added rdocs for symbol.nobu2009-09-181-0/+88
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: fixed types.nobu2009-09-181-40/+45
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use rb_isspace for ASCII-incompatible strings.naruse2009-09-151-4/+4
| | | | | | | | | * string.c (rb_str_split_m): use rb_isspace when the string may be ASCII-incompatible. (rb_str_lstrip_bang): ditto. (rb_str_rstrip_bang): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_lstrip_bang): use ascii_isspace(). [ruby-dev:39322]matz2009-09-141-5/+5
| | | | | | | | * string.c (rb_str_rstrip_bang): ditto. * string.c (rb_str_split_m): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): use rb_enc_mbc_to_codepointnaruse2009-09-141-2/+1
| | | | | | because we already knew char is found and got length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e