summaryrefslogtreecommitdiff
path: root/hash.c
AgeCommit message (Collapse)Author
2007-01-31* removed svn:keywords for compatibility.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@11599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-05backport from ruby_1_8shyouhei
* hash.c (rb_hash_s_create): fixed memory leak, based on the patch 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_5@11345 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
2003-06-23* dir.c (find_dirsep): get rid of warnings.nobu
* eval.c (error_print): temporary value might be disposed by GC. * hash.c (env_has_value, env_index): should not increment NULL. * io.c (io_read, rb_io_sysread): not read when length is 0. * io.c (rb_io_reopen): ensure initialized IO. * io.c (rb_io_init_copy): sychronize file pointer. * io.c (rb_io_s_pipe): make exception proof. * string.c (rb_str_rindex_m): Fixnum 0 matched end of string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23* string.c (rb_str_upto): generate sequence according to "succ"matz
order. formerly check was done by dictionary order. [ruby-talk:74138] * string.c (rb_string_value): fill constant empty string along with setting ELTS_SHARED if str->ptr is NULL. [ruby-core:01179] * string.c (rb_string_value_ptr): ditto. * string.c (rb_check_string_type): ditto. * string.c (str_gsub): move END(0) check before mbclen2(). * string.c (scan_once): reduce END(0) check. * io.c (rb_io_initialize): accept fixnum mode. * eval.c (error_print): replace strchr() by memchr(), einfo may contain "\0". * pack.c (pack_unpack): range check for "@" move; initialize check for "m". * error.c (syserr_initialize): avoid buffer overflow. * file.c (rb_file_s_readlink): expand buffer until readlink succeed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-20* defines.h (PATH_ENV): name of PATH environment. [new].usa
* defines.h (ENV_IGNORECASE): define for case insensitive platforms to access environment variables. * dln.c (dln_find_exe): use PATH_ENV instead of "PATH". * hash.c (env_delete, rb_f_getenv, env_fetch, rb_env_path_tainted, env_aset): ditto. * ruby.c (proc_options): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-19* hash.c (env_delete, rb_f_getenv, env_fetch): case insensitive tousa
access environment variables on DOSISH platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-16* eval.c (proc_alloc): re-unification of Block and Proc. Blockmatz
class is no longer available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06* gc.c (define_final): eliminate rb_f_lambda() call.matz
* class.c (rb_scan_args): ditto. * signal.c (sig_trap): ditto. * hash.c (rb_hash_initialize): ditto. * variable.c (rb_f_trace_var): ditto. * ext/dl/dl.c (rb_dl_callback): ditto. * ext/win32ole/win32ole.c (ev_on_event): ditto. * eval.c (ruby_cleanup): $SAFE is turned off in the finalization. Each END proc should preserve its own $SAFE level. [ruby-core:01119] * marshal.c (marshal_load): remove unused variable "hash". [ruby-core:01120] * hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860] * array.c (rb_ary_first): optional argument to retrieve first n elements. * array.c (rb_ary_last): optional argument to retrieve last n elements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06* eval.c (ruby_cleanup): $SAFE is turned off in the finalization.matz
Each END proc should preserve its own $SAFE level. [ruby-core:01119] * marshal.c (marshal_load): remove unused variable "hash". [ruby-core:01120] * hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860] * array.c (rb_ary_first): optional argument to retrieve first n elements. * array.c (rb_ary_last): optional argument to retrieve last n elements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-26* eval.c (Init_Proc): Block/Proc separation. [huge change]matz
* eval.c (block_arity): returns exact arity number for Procs out of methods. also gives 1 for {|a|..}. * string.c (rb_str_match): revert use of String#index for invocation like string =~ string. * eval.c (rb_Array): move Object#to_a exclusion hack from splat_value(). need to be in eval.c for a while. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-20* eval.c (rb_yield_0): give warning for multiple values for amatz
block parameter. * eval.c (rb_yield_values): a function to yield multiple values. * array.c (sort_1): use rb_yield_values. * enum.c (min_ii, max_ii): ditto. * hash.c (rb_hash_update_block_i, delete_if_i, select_i, each_pair_i, env_each, env_reject_bang, env_select, env_update_i): ditto. * struct.c (rb_struct_each_pair): ditto. * eval.c (top_include): should include module in the current self, not ruby_top_self. [ruby-dev:20198] * eval.c (top_include): stop inclusion to ruby_wrapper; give warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-19* class.c: add #include "version.h".aamine
* hash.c: ditto. * string.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-19* object.c (init_copy): rename copy_object as initialize_copy,matz
since it works as copy constructor. * eval.c (rb_add_method): initialize_copy should always be private, like initialize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-06* object.c (rb_obj_methods): list singleton methods if recurmatz
argument is false; list all methods otherwise. * numeric.c (num_step): double epsilon to make "1.1.step(1.5,0.1)" to work. * ext/gdbm/gdbm.c (fgdbm_values_at): new method to replace select(index..). * ext/sdbm/init.c (fsdbm_values_at): ditto. * ext/dbm/dbm.c (fdbm_values_at): ditto. * ext/dbm/dbm.c (DBM::VERSION): defined. * ext/gdbm/testgdbm.rb: replace select with values_at. * ext/sdbm/testsdbm.rb: ditto. * ext/dbm/testdbm.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-04* array.c (rb_ary_values_at): new method to replace select(index..).matz
* hash.c (rb_hash_values_at,env_values_at): ditto. * re.c (match_values_at): ditto. * struct.c (rb_struct_values_at): ditto. * re.c (match_select): add iterator behavior. * ext/curses/curses.c, ext/digest/sha2/sha2.c, ext/iconv/iconv.c, ext/racc/cparse/cparse.c: include "ruby.h" at the top to shut up "_FILE_OFFSET_BITS redefined" warning on Solaris. * class.c (rb_class_protected_instance_methods): now gives warnings to show migration path. The default will be reversed on Jan 2004. * numeric.c (num_step): "1.1.step(1.5,0.1)" to work. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-03* eval.c (rb_f_missing): use "inspect" for T_OBJECT as well.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-31* hash.c (env_reject_bang): untaint key string.matz
* hash.c (env_delete_m): execute block only if deleting key does not exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e