summaryrefslogtreecommitdiff
path: root/array.c
AgeCommit message (Collapse)Author
2004-10-30* string.c (rb_str_locktmp): lock string temporarily.matz
* string.c (str_independent): add tmplock check. * io.c (io_write): lock output string temporarily. [ruby-dev:24649] * io.c (io_write): use rb_str_locktmp(). * io.c (read_all): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-20* string.c (str_gsub): reentrant check. [ruby-dev:24432]matz
* backport all SEGV bug fixes from CVS HEAD. [ruby-dev:24536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-07* pack.c (pack_unpack): string conversion should at the top of thematz
method. [ruby-dev:24439] * io.c (io_read): buffer should be frozen only after the length check. [ruby-dev:24440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7010 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_equal): merge miss.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6941 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-09-18* array.c (rb_ary_equal): element size might change duringmatz
comparison. [ruby-dev:24254] * array.c (rb_ary_diff): ditto. [ruby-dev:24274] * array.c (rb_ary_select): ditto. [ruby-dev:24278] * array.c (rb_ary_delete): ditto. [ruby-dev:24283] * array.c (rb_ary_rindex): ditto. [ruby-dev:24275] * array.c (rb_ary_initialize): element size might change during initializing block. [ruby-dev:24284] * dir.c (dir_s_chdir): avoid memory leak and unnecessary chdir to the original directory when exception has caused in changing direcotry or within block. thanks to Johan Holmberg <holmberg@iar.se> [ruby-core:03446] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-24* range.c (rb_range_beg_len): returns Qnil only when "beg" pointsmatz
outside of a range. No boundary check for "end". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-13* array.c: rdoc patch - unified margin.ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-13* array.c: rdoc patch. merged patch from Johan Holmbergocean
<holmberg@iar.se> [ruby-core:3170] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-09* array.c, enum.c, pack.c: rdoc patch from Johan Holmbergocean
<holmberg@iar.se> [ruby-core:3132] [ruby-core:3136] * numeric.c: rdoc patch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-14* array.c, enum.c, eval.c, file.c, io.c, numeric.c, object.c, prec.c,nobu
process.c, re.c, string.c: typos in RDoc comments. [ruby-core:02783] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6158 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
2004-02-26Doug Kearns's doc. patchdave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-30Add RDoc for kernel functions, and tidy updave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-29Tidy array.c rdocdave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-23Fix doc typosdave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-16Put RDoc comments into array.c, and refine rdoc/ri to deal with stuff that arosedave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5202 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* 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-09-05* eval.c (mark_frame_adj): need to adjust argv pointer if usingmatz
system's alloca. [ruby-core:01503] * io.c (rb_f_gets): should call next_argv() before type check current_file. [ruby-list:38336] * eval.c (proc_invoke): should retrieve retval when pcall is true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-06* eval.c (rb_call0): update ruby_class as well as ruby_cref.matz
(ruby-bugs-ja PR#540) * eval.c (rb_yield_0): remove ruby_frame->cbase and unify to ruby_cref. [ruby-talk:78141] * eval.c: initialize /* OK */ variables by Qnil to stop warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4346 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-31 * array.c (rb_ary_collect): must get length of array for eachusa
iteration. reported on [ruby-talk:77500], and fixed by K.Sasada <ko1@namikilab.tuat.ac.jp> on [ruby-talk:77504] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4240 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-03* array.c (rb_values_at): extract common procedure frommatz
rb_ary_values_at. follow DRY principle. * re.c (match_values_at): values_at should understand ranges. * struct.c (rb_struct_values_at): ditto. * struct.c (inspect_struct): inspect format changed; add "struct " at the top. * sprintf.c (rb_f_sprintf): "%p" specifier for inspect output. (RCR#68) * eval.c (rb_mod_undef_method): allow "undef_method" to accept multiple arguments. (RCR#146) * lib/timeout.rb: put timeout in Timeout module. (RCR#121) [ruby-talk:61028] * re.c (match_groups): new method added. (RCR#139) * variable.c (rb_mod_const_of): should exclude constant defined in Object, unless retrieving constants of Object. * string.c (rb_str_new4): do not allocate new string if original is frozen or already have copy-on-write entry. [ruby-talk:74940] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23* array.c (rb_ary_unshift_m): need to check number of arguments.nobu
[ruby-talk:74189] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3991 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-06-02* array.c (push_values_at): Array#values_at should work withmatz
ranges too. * range.c (rb_range_beg_len): length calculation was wrong. * eval.c (rb_call): should set T_ICLASS in the frame->last_class. [ruby-core:01110] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3899 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* ext/pty/pty.c (pty_finalize_syswait): join (using Thread#value)matz
before detach pid. [ruby-talk:71519] * eval.c (PUSH_FRAME): save outer ruby_block. [ruby-list:37677], [ruby-dev:20202] * eval.c (BEGIN_CALLARGS): restore outer block by using ruby_block->outer. * eval.c (block_pass): do not alter block->prev, but block->outer. * array.c (get_inspect_tbl): warning on wrong condition. * eval.c (localjump_xvalue): renamed exitstatus to exit_value since it's not exit "status" after all. * eval.c (localjump_error): add reason to LocalJumpError. * compar.c (rb_cmpint): raise error via rb_cmperr(), if cmp value is nil. now take new 2 arguments. * time.c (time_cmp): 2003-05-16 fix was incomplete. (ruby-bugs-ja:PR#458) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3823 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-19* array.c (get_inspect_tbl): check whether inspect_tbl value is amatz
valid array. (ruby-bugs-ja PR#65) * array.c (inspect_ensure,rb_protect_inspect,rb_inspecting_p): use get_inspect_tbl(). * eval.c (rb_f_abort): call exit(1) if exception is raised. This patch was made by Nobuyoshi Nakada <nobu.nokada@softhome.net> on 2002-05-30. (ruby-bugs-ja PR#236) * signal.c: disable Ruby's interrupt handler at the beginning. (ruby-bugs-ja PR#236) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3817 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-05-02* string.c (rb_str_ljust): now takes optional argument to specifymatz
pad string. [ruby-talk:70482] * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. * string.c (rb_str_justify): utility function. * eval.c (rb_add_method): call singleton_method_added or method_added for every method definition (after ruby_running). [ruby-talk:70471] * array.c (rb_ary_reverse_bang): Array#reverse! should not return nil even for arrays sized less than 2. * io.c (argf_eof): should not block after reading all argument files. (ruby-bugs-ja PR#449) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-10added some checks for request size.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3665 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-04* array.c (rb_ary_aref): give warning if index is a symbol.matz
[ruby-list:37217] * array.c (rb_ary_aset): raise TypeError if index is a symbol. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-10* array.c (rb_ary_to_a): return value should be an Array if thematz
receiver is an instance of subclass of Array. * string.c (rb_str_to_s): return value should be a String if the receiver is an instance of subclass of String. * eval.c (rb_call): calls method_missing when superclass method does not exist. * eval.c (rb_f_missing): now handles "no super" case. * object.c (rb_obj_ivar_get): Object#instance_variable_get: new method to get instance variable value without eval(). [new] * object.c (rb_obj_ivar_set): Object#instance_variable_set: new method to set instance variable value without eval(). [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-04typonobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-04* array.c (rb_ary_equal): a == b is true when b is non T_ARRAYmatz
object, if b has "to_ary" and b == a. * hash.c (rb_hash_equal): a == b is true when b is non T_HASH object, if b has "to_hash" and b == a. * string.c (rb_str_equal): a == b is true when b is non T_STRING object, if b has "to_str" and b == a. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-03* object.c (Init_Object): default Object#=== now calls "=="matz
internally. * re.c (rb_reg_initialize_m): should honor option status of original regexp. * array.c (rb_ary_equal): ary2 should be T_ARRAY (no to_ary conversion). * array.c (rb_ary_eql): ditto. * string.c (rb_str_equal): str2 should be T_STRING (no to_str conversion). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-03* re.c (rb_memsearch): algolithm body of String#index.matz
* error.c (Init_Exception): "to_str" removed. * eval.c (eval): should not rely on Exception#to_str * eval.c (compile_error): ditto. * error.c (err_append): ditto. * hash.c (rb_hash_merge): Hash#merge, non destructive "update". now there's also Hash#merge! which is an alias to "update". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16Updated Copyrights of Matz to 2003.michal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-08* range.c (range_each): treat fixnums specially to boost.matz
* numeric.c (num_step): remove rb_scan_args() for small speedup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-07* hash.c (env_clear): new Hash compatible method.matz
* hash.c (env_shift): ditto. * hash.c (env_invert): ditto. * hash.c (env_replace): ditto. * hash.c (env_update): ditto. * array.c (rb_ary_join): dispatch based on "to_str". * array.c (rb_ary_times): ditto. * array.c (rb_ary_equal): ditto. * process.c (rb_f_exec): dispatch based on "to_ary". * eval.c (umethod_bind): exact class match is not required. relax the restriction to subclasses. * eval.c (rb_eval): call "inherited" before executing class body. * class.c (rb_define_class): call "inherited" after defining the constant. * class.c (rb_define_class_under): ditto. * eval.c (massign): expand first element if RHS is an array and its size is 1, and LHS has concrete assignment target (i.e. LHS has target(s) other than *var). * eval.c (massign): avoid unnecessary avalue/svalue conversion. * eval.c (rb_yield_0): ditto * array.c (rb_ary_update): do not allocate unused array if rpl is nil (i.e. merely removing elements). * io.c (io_read): should resize supplied string if it's shorter than expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-01* eval.c (massign): removed awkward conversion between yvalue,matz
mvalue, etc. * eval.c (rb_yield_0): new parameter added to tell whether val is an array value or not. * parse.y (yield_args): restructuring: new nodes: NODE_RESTARY2, NODE_SVALUE; removed node: NODE_RESTARGS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e