summaryrefslogtreecommitdiff
path: root/hash.c
AgeCommit message (Collapse)Author
2009-12-14merge revision(s) 25766:shyouhei
* hash.c (ruby_setenv): get rid of crash in Solaris 8 and 10. [ruby-core:26668] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@26087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-13merge revision(s) 25659:25661:shyouhei
* hash.c (rb_hash): always return a fixnum value because a return value of rb_hash may be used as a hash value itself and bignums have no unique VALUE. * test/ruby/test_hash.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@26081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-23merge revision(s) 21423:shyouhei
* hash.c (rb_hash_s_create): set nil as the value if assoc length is not enough. [ruby-core:21249] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08* hash.c (hash_i): make Hash#hash order insensitive.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-25Merge from ruby_1_8.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-21Merge from ruby_1_8.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-21Merge from ruby_1_8.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-19Merge everything from ruby_1_8.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14* array.c (rb_ary_collect_bang, rb_ary_select): Return anknu
enumerator if no block is given. * dir.c (dir_each, dir_foreach): Return an enumerator if no block is given. * enum.c (enum_partition, enum_sort_by): Ditto. * gc.c (os_each_obj): Ditto. * hash.c (rb_hash_delete_if, rb_hash_reject_bang, rb_hash_select, rb_hash_each_value, rb_hash_each_key, rb_hash_each_pair, env_each_key, env_each_value, env_each, env_each_pair, env_reject_bang, env_delete_if, env_select): Ditto. * numeric.c (num_step, int_upto, int_downto, int_dotimes): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-03* hash.c (rb_any_hash): shrinks all results in Fixnum range.nobu
[ruby-core:15713] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-02* array.c (rb_ary_assoc): check and convert inner arrays (assocs)matz
using #to_ary. * hash.c (rb_hash_s_create): check and convert argument hash using #to_hash. * hash.c (rb_hash_s_create): Hash#[] now takes assocs as source of hash conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-21* hash.c (st_foreach_func, rb_foreach_func): typedefed.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-15* hash.c (rb_hash_delete_key): delete the entry without calling block.nobu
* hash.c (rb_hash_shift): should consider iter_lev too. * hash.c (delete_if_i): use rb_hash_delete_key() so that the block isn't called twice. [ruby-core:11556] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-29* hash.c: purged trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-22* hash.c (rb_hash_select): remove unnecessary varargs formatz
rb_hash_select. a patch from Daniel Berger <Daniel.Berger at qwest.com>. [ruby-core:11527] * hash.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-23* hash.c: added documentation for Hash about how it uses eql? andmatz
hash methods for the keys. [ruby-core:09995] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-29* hash.c (rb_hash_s_create): fixed memory leak, based on the patchnobu
by Kent Sibilev <ksruby at gmail.com>. fixed: [ruby-talk:211233] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-06* hash.c (rb_hash_default): should not call default procedure ifmatz
no key is given. [ruby-list:42541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-01* configure.in, hash.c (ruby_setenv): use setenv(3) and unsetenv(3)ocean
where they are supported. modifing environ variable seems to segfault solaris 10. [ruby-core:7276] [ruby-dev:28270] * ruby.c (set_arg0): if use setenv(3), environ space cannot be used for altering argv[0]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-19* io.c (rb_io_inspect): replace sprintf() with "%s" format allmatz
over the place by snprintf() to avoid integer overflow. * sample/svr.rb: service can be stopped by ill-behaved client; use tsvr.rb instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-28* dir.c, eval.c, hash.c, process.c, ruby.c: avoid warning "unusedocean
variable" [ruby-dev:26387] (patch from Kazuhiro NISHIYAMA) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-13* hash.c (ruby_setenv): fixed SEGV. [ruby-dev:26186]ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-28* exception error messages updated. [ruby-core:04497]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-08* lib/cgi.rb (CGI::Cookie): [ruby-talk:130040]matz
* object.c: [ruby-doc:818] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-18* dir.c (dir_open_dir): new function. [ruby-dev:25242]matz
* hash.c (Init_Hash): remove custom "hash" and "eql?". * lib/set.rb (Set::eql): wrong definition. [ruby-dev:25207] * object.c (rb_obj_id_obsolete): warn always. * eval.c (rb_enable_super): ditto. * lib/set.rb (Set#==): [ruby-dev:25206] * lib/pstore.rb (PStore#transaction): Use the empty content when a file is not found. [ruby-dev:24561] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-06* process.c (proc_setgroups): [ruby-dev:25081]matz
* re.c (rb_reg_eqq): document fix. [ruby-talk:122541] * ext/socket/socket.c (sock_connect): use rb_str_new4(). [ruby-dev:25052] * io.c (io_write): remove rb_str_locktmp(). [ruby-dev:25050] * io.c (io_fwrite): takes VALUE string as an argument. [ruby-dev:25050] * ext/socket/socket.c (sock_connect): remove rb_str_locktmp(). [ruby-dev:25050] * ext/socket/socket.c (udp_connect): [ruby-dev:25045] * ext/socket/socket.c (udp_bind): ditto. * ext/socket/socket.c (udp_send): ditto. * ext/socket/socket.c (bsock_send): ditto. * ext/socket/socket.c (s_recvfrom): ditto. * hash.c (rb_hash_hash): should provide "hash" method where "eql?" is redefined. [ruby-talk:122482] * ext/socket/socket.c (bsock_setsockopt): [ruby-dev:25039] * hash.c (rb_hash_hash): should provide "hash" method where "eql?" is redefined. [ruby-talk:122482] * ext/socket/socket.c (bsock_setsockopt): [ruby-dev:25039] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-16* numeric.c (flo_divmod): protect float values from GC bymatz
assignment to local variables. [ruby-dev:24873] * string.c (str_mod_check): frozen check should be separated. [ruby-core:3742] * array.c (rb_ary_update): pedantic check to detect rb_ary_to_ary() to modify the receiver. [ruby-dev:24861] * string.c (rb_str_justify): typo fixed. [ruby-dev:24851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-02* string.c (rb_str_sum): check was done with false pointer.matz
[ruby-dev:24383] * string.c (rb_str_sum): string may be altered. [ruby-dev:24381] * eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe sourcefile string modification. [ruby-dev:24373] * io.c (io_read): block string buffer modification during rb_io_fread() by freezing it temporarily. [ruby-dev:24366] * io.c (rb_io_s_popen): mode argument may be altered. [ruby-dev:24375] * file.c (rb_file_s_basename): ext argument may be altered. [ruby-dev:24377] * enum.c (enum_sort_by): use NODE instead of 2 element arrays. [ruby-dev:24378] * string.c (rb_str_chomp_bang): StringValue() may change the receiver. [ruby-dev:24371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-22* hash.c (rb_hash_rehash): add iteration check. [ruby-dev:24301]matz
* st.c (st_foreach): add deep check. * array.c (rb_ary_collect_bang): element size might change during comparison. [ruby-dev:24300] * array.c (rb_ary_reject_bang): ditto. [ruby-dev:24300] * array.c (rb_ary_eql): ditto. [ruby-dev:24300] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-21* array.c (rb_ary_uniq_bang): element size might change duringmatz
comparison. [ruby-dev:24298] * enum.c (enum_sort_by): do not use qsort directly. use rb_ary_sort_bang() instead. [ruby-dev:24291] * enum.c (enum_sort_by): pedantic type check added. [ruby-dev:24291] * hash.c (rb_hash_foreach_iter): check iter_lev after each iteration. [ruby-dev:24289] * array.c (rb_ary_and): element size might change during comparison. [ruby-dev:24290] * array.c (rb_ary_or): ditto. [ruby-dev:24292] * array.c (rb_ary_equal): wrong fix. [ruby-dev:24286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-13* hash.c (delete_if_i): use st_delete_safe() (viaeban
rb_hash_delete()) instead of returning ST_DELETE. backport from HEAD. [ruby-dev:23487] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-07* eval.c (rb_eval): too many line trace call. (ruby-bugs PR#1320)matz
* numeric.c (flo_to_s): tweak output string based to preserve decimal point and to remove trailing zeros. [ruby-talk:97891] * string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM search. [ruby-talk:97342] * hash.c (rb_hash_equal): returns true if two hashes have same set of key-value set. [ruby-talk:97559] * hash.c (rb_hash_eql): returns true if two hashes are equal and have same default values. * string.c (rb_str_equal): always returns true or false, never returns nil. [ruby-dev:23404] * io.c (rb_io_reopen): should use rb_io_check_io(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-05* eval.c (top_include): include in the wrapped load is done formatz
the wrapper, not for a singleton class for wrapped main. [ruby-dev:23305] * bignum.c (rb_big_eq): use temporary double variable to save the result (internal float register may be bigger than 64 bits, for example, 80 bits on x86). [ruby-dev:23311] * eval.c (block_pass): should generate unique identifier of the pushing block. [ruby-talk:96363] * ext/socket/socket.c (make_hostent): fix memory leak, based on the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-23RDoc comments for Fixnum, Float, and Hash. Add heuristic to RDoc to handle ↵dave
yaml/stringio git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-22* eval.c (rb_with_disable_interrupt): use ENABLE_INTS instead ofmatz
ALLOW_INTS which may switch context. [ruby-dev:22319] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-20dln.c: remove last second typo.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-19* misc/ruby-mode.el (ruby-calculate-indent): proper indentationmatz
inside of parentheses. [ruby-dev:22308] * hash.c (delete_if_i): do not use ST_DELETE for thread safety. [ruby-dev:21899] (not fully solved) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-28* hash.c (env_has_value, env_index): must match exactly.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-25* defines.h (ENV_IGNORECASE): should define when DOSISH withoutusa
human68k. * hash.c (env_has_value, env_index): don't ignore case of value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-15* hash.c: remove unnecessary update.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-14* eval.c (rb_method_node): new API to retrieve method body.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-06* eval.c (rb_load): allow interrupt during loaded programmatz
evaluation. [ruby-dev:21834] * hash.c (rb_hash_fetch): always warn if default argument and a block are supplied at the same time. [ruby-dev:21842] * hash.c (env_fetch): ditto. * array.c (rb_ary_fetch): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-04* class.c, hash.c, string.c: remove #include "version.h".eban
* Makefile.in: remove needless version.h dependency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-04* io.c (read_all): fptr->f may be NULL, if IO is closed in thematz
signal handler. * io.c (io_read): ditto. * string.c (get_pat): remove 1.8.0 warning code. * string.c (rb_str_match): extend warning until 1.8.2. * string.c (rb_str_match2): ditto. * class.c (class_instance_method_list): remove 1.8.0 warnings. method_list now recurs. [ruby-dev:21816] * class.c (rb_obj_singleton_methods): ditto. * array.c (rb_ary_select): remove select with block. [ruby-dev:21824] * hash.c (rb_hash_select): ditto. * hash.c (env_select): ditto. * re.c (match_select): ditto. * struct.c (rb_struct_select): ditto. * process.c (check_uid_switch): remove duplicated error messages. * process.c (check_gid_switch): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-24* hash.c (rb_hash_each): Hash#each should yield single value.matz
[ruby-talk:84420] * hash.c (env_each): ditto for ENV.each. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01* class.c (rb_obj_singleton_methods): should not go up tomatz
ancestors unless the recursive flag is set. [ruby-list:38007] * hash.c (env_each_key): use env_keys to avoid environment modify on the fly. * hash.c (env_each_value): use env_values for safety. * hash.c (env_each): allocate environment array first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01* eval.c (BEGIN_CALLARGS): should not always reset ruby_iter,matz
need to restore previous value. [ruby-talk:77577] * array.c (rb_ary_fill): array length may be changed during the block execution. [ruby-talk:77579] * array.c (rb_ary_zip): ditto. * array.c (rb_ary_fill): ditto. * hash.c (env_reject_bang): length may be changed during the block execution. * hash.c (env_clear): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-25* ext/socket/socket.c (tcp_s_gethostbyname): was usingmatz
uninitialized size_t value. [ruby-talk:76946] * Minor cleanups. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24* gcc -Wall clean-up.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-15* lib/matrix.rb: remove elements conversion to_f, to_i, to_r.matz
* lib/cgi/session/pstore.rb: add new file. * process.c (proc_getgroups, proc_setmaxgroups): fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e