suggested by Bertram Scharpf <lists@bertram-scharpf.de> in
[ruby-talk:134083].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_exec_recursive() in eval.c.
* eval.c (rb_exec_recursive): new function.
* array.c (rb_ary_join): use rb_exec_recursive().
* array.c (rb_ary_inspect, rb_ary_hash): ditto.
* file.c (rb_file_join): ditto.
* hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto.
* io.c (rb_io_puts): ditto.
* object.c (rb_obj_inspect): ditto
* struct.c (rb_struct_inspect): ditto.
* lib/set.rb (SortedSet::setup): a hack to shut up warning.
[ruby-talk:132866]
* lib/time.rb (Time::strptime): add new function. inspired by
[ruby-talk:132815].
* lib/parsedate.rb (ParseDate::strptime): ditto.
* regparse.c: move st_*_strend() functions from st.c. fixed some
potential memory leaks.
* exception error messages updated. [ruby-core:04497]
* ext/socket/socket.c (Init_socket): add bunch of Socket
constants. Patch from Sam Roberts <sroberts@uniserve.com>.
[ruby-core:04409]
* array.c (rb_ary_s_create): no need for negative argc check.
[ruby-core:04463]
* array.c (rb_ary_unshift_m): ditto.
* lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass
of StandardError class, not Exception class. [ruby-core:04429]
* parse.y (fcall_gen): lvar(arg) will be evaluated as
lvar.call(arg) when lvar is a defined local variable. [new]
* object.c (rb_class_initialize): call inherited method before
calling initializing block.
* eval.c (rb_thread_start_1): initialize newly pushed frame.
* lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
fixed: [ruby-core:04444]
* eval.c (is_defined): NODE_IASGN is an assignment.
* ext/readline/readline.c (Readline.readline): use rl_outstream
and rl_instream. [ruby-dev:25699]
* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check
[ruby-dev:25675]
* misc/ruby-mode.el: [ruby-core:04415]
* lib/rdoc/generators/html_generator.rb: [ruby-core:04412]
* lib/rdoc/generators/ri_generator.rb: ditto.
* struct.c (make_struct): fixed: [ruby-core:04402]
* ext/curses/curses.c (window_color_set): [ruby-core:04393]
* ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
[ruby-talk:130092]
* object.c: [ruby-doc:818]
* parse.y (open_args): fix too verbose warnings for the space
before argument parentheses. [ruby-dev:25492]
* parse.y (parser_yylex): ditto.
* parse.y (parser_yylex): the first expression in the parentheses
should not be a command. [ruby-dev:25492]
* lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]
* object.c (Init_Object): remove Object#type. [ruby-core:04335]
* st.c (st_foreach): report success/failure by return value.
[ruby-Bugs-1396]
* parse.y: forgot to initialize parser struct. [ruby-dev:25492]
* parse.y (parser_yylex): no tLABEL on EXPR_BEG.
[ruby-talk:127711]
* document updates - [ruby-core:04296], [ruby-core:04301],
[ruby-core:04302], [ruby-core:04307]
* dir.c (rb_push_glob): should work for NUL delimited patterns.
* dir.c (rb_glob2): should aware of offset in the pattern.
* string.c (rb_str_new4): should propagate taintedness.
* env.h: rename member names in struct FRAME; last_func -> callee,
orig_func -> this_func, last_class -> this_class.
* struct.c (rb_struct_set): use original method name, not callee
name, to retrieve member slot. [ruby-core:04268]
* time.c (time_strftime): protect from format modification from GC
finalizers.
* object.c (Init_Object): remove rb_obj_id_obsolete()
* eval.c (rb_mod_define_method): incomplete subclass check.
[ruby-dev:25464]
* gc.c (rb_data_object_alloc): klass may be NULL.
[ruby-list:40498]
* bignum.c (rb_big_rand): should return positive random number.
[ruby-dev:25401]
* bignum.c (rb_big_rand): do not use rb_big_modulo to generate
random bignums. [ruby-dev:25396]
* variable.c (rb_autoload): [ruby-dev:25373]
* eval.c (svalue_to_avalue): [ruby-dev:25366]
* string.c (rb_str_justify): [ruby-dev:25367]
* io.c (rb_f_select): [ruby-dev:25312]
* ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072]
* struct.c (make_struct): [ruby-dev:25249]
* dir.c (dir_open_dir): new function. [ruby-dev:25242]
* io.c (rb_f_open): add type check for return value from to_open.
* 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/trunk@8068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_update): a[n,m]=nil no longer works as element
deletion.
* enum.c (enum_sort_by): protect continuation jump in.
[ruby-dev:24642]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-talk:117841]
* ruby.h (FL_ABLE): nodes are not subject for flag operations.
* io.c (ARGF_FORWARD): should have specified argv explicitly,
since we no longer have frame->argv saved. [ruby-dev:24602]
* string.c (RESIZE_CAPA): check string attribute before modifying
capacity member of string structure. [ruby-dev:24594]
* ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
performance. [ruby-talk:117701]
* sprintf.c (rb_f_sprintf): raise ArgumentError for extra
arguments, unless (digit)$ style used.
* io.c (rb_io_fptr_finalize): leave stdin/stdout/stderr open in
interpreter termination. [ruby-dev:24579]
* eval.c (frame_free): Guy Decoux solved the leak problem.
Thanks. [ruby-core:03549]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
the class of right operand. [ruby-dev:24526]
* ext/zlib/zlib.c (zstream_detach_buffer): should not expose
class-less object to Ruby world. [ruby-dev:24530]
* eval.c (proc_dup): provide Proc#dup as well. [ruby-talk:116915]
* eval.c (ruby_exec): stack marking position may be higher than
expected. thanks to Guy Decoux. [ruby-core:03527]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_flags_mode): requires output buffer no more. no
allocation needed.
* array.c (rb_ary_index): takes a block to compare items in an
array. [ruby-talk:113069] [Ruby2]
* array.c (rb_ary_rindex): ditto.
* marshal.c (r_byte): retrieve pointer from string value for each
time. [ruby-dev:24404]
* marshal.c (r_bytes0): ditto.
* enum.c (sort_by_i): re-entrance check added. [ruby-dev:24399]
* io.c (io_read): should freeze all reading buffer.
[ruby-dev:24400]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-dev:24348]
* array.c (rb_ary_fill): fill should honor length argument.
[ruby-dev:24346]
* array.c (rb_ary_replace): should not use ptr from shared array.
[ruby-dev:24345]
* ext/socket/socket.c (s_accept): don't retry for EWOULDBLOCK.
[ruby-talk:113807]
* array.c (flatten): element size might change during comparison.
[ruby-dev:24343]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[llama@u01.gate0]
* parse.y (rb_parser_while_loop): ditto.
* array.c (rb_ary_subseq): original object might be modified after
sharing data creation. [ruby-dev:24327]
* array.c (rb_ary_replace): ditto.
* array.c (ary_make_shared): freeze shared array. [ruby-dev:24325]
* struct.c (struct_members): always check struct size and size of
members list in the class. [ruby-dev:24320]
* string.c (rb_str_sub_bang): check if string is not modified
during iteration. [ruby-dev:24315]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
size. [ruby-dev:24273]
* parse.y: make ruby parser reentrant. merge ripper parser to the
real one. this change makes ruby require bison.
* file.c (rb_file_truncate): clear stdio buffer before truncating
the file. [ruby-dev:24191]
* ext/digest/digest.c: use rb_obj_class() instead of CLASS_OF
which might return singleton class. [ruby-dev:24202]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_pop_m, rb_ary_shift_m): take arg to behave as push
and unshift.
* array.c (rb_ary_first, rb_ary_last): make shared array for result
array, and correct doc for Array#first(n) and Array#last(n)
* array.c (rb_ary_select): not accept any arg.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c: ditto.
* ext/dbm/dbm.c: remove #indexes, #indices, "values_at" warning
from #select.
* ext/gdbm/gdbm.c: ditto.
* ext/sdbm/init.c: ditto.
* ext/dbm/dbm.c (Init_dbm): set VERSION constant as "unknown" when
DB_VERSION_STRING is not available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
is same to @end. [ruby-talk:100269]
* string.c (rb_str_new4): should not reuse frozen shared string if
the original is not an instance of String. [ruby-talk:100193]
* time.c (time_mdump): preserve GMT bit in the marshal data.
[ruby-talk:100213]
* eval.c (is_defined): do not protect exception during receiver
evaluation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
unnecessary line trace for inlined expression.
(ruby-bugs PR#1320)
* 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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
path object is not a string. [Ruby2]
* gc.c (rb_gc_call_finalizer_at_exit): do not free threads in the
exit finalizers.
* io.c (rb_io_reopen): should use rb_io_check_io().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-talk:95409]
* eval.c (rb_f_raise): should not clear backtrace information if
exception object already have one.
* parse.y (assoc_list): allow {sym: val} style Hash. [Ruby2]
this change is done by Nobuyoshi Nakada <nobu@ruby-lang.org>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
one defined in object.c.
* object.c (Init_Object): remove Kernel#to_a.
* enum.c (enum_zip): use "to_a" instead of "to_ary".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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
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
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
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
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
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
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
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
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
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
* 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
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
[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
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
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
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
* 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
* 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
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
* file.c (rb_file_s_chmod): Do not directly cast an int to void *
to avoid a warning.
* defines.h (FLUSH_REGISTER_WINDOWS): Add support for
FreeBSD/sparc64. miniruby still coredumps in a different place,
though.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (cmd_brace_block): new tLBRACE_ARG block rule
* parse.y (command): can take optional cmd_brace_block; use %prec
to resolve shift/reduce conflict. (ruby-bugs-ja PR#372)
* eval.c (ruby_finalize): trace_func should be cleared here (after
executing exit procs and finalizers).
* eval.c (rb_define_alloc_func): new allocation framework, based
on Nobu's work [ruby-dev:19116]. "allocate" method is no longer
used for object allocation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_check_array_type): new function: return an array
(convert if possible), or nil.
* string.c (rb_check_string_type): new function: return a string
(convert if possible), or nil.
* numeric.c (rb_dbl_cmp): returns nil if values are not
comparable.
* numeric.c (fix_cmp,flo_cmp): use rb_num_coerce_cmp()
* bignum.c (rb_big_cmp): ditto.
* numeric.c (rb_num_coerce_cmp): new coercing function for "<=>",
which does not raise TypeError.
* numeric.c (do_coerce): can be supress exception now.
* object.c (rb_mod_cmp): should return nil for non class/module
objects.
* re.c (rb_reg_eqq): return false if the argument is not a
string. now returns boolean value.
* class.c (rb_include_module): argument should be T_MODULE, not
T_class, nor T_ICLASS.
* eval.c (is_defined): "defined?" should return "assignment" for
attribute assignment (e.g. a.foo=b) and indexed assignment
(e.g. a[2] = 44).
* parse.y (aryset): use NODE_ATTRASGN.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
still left; removed.
* sprintf.c (rb_f_sprintf): should not prepend '0' if width > prec
for example "%5.3d".
* process.c (Init_process): add Process.exit and Process.abort
* pack.c (utf8_to_uv): raise ArgumentError for malformed/redundant
UTF-8 sequences.
* process.c (last_status_set): add pid attribute to Process::Status.
* pack.c (uv_to_utf8): limit maximum length of the encoded string
to 6 bytes, even when the platform supports 8 bytes long integers.
* pack.c (utf8_to_uv): do not decode sequences longer than 6 bytes.
* object.c (copy_object): use "copy_object" method, not "become".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
empty path, just ignore.
* dir.c: remove <sys/parm.h> inclusion.
* compar.c (cmp_eq,cmp_gt,cmp_ge,cmp_lt,cmp_le): check using
rb_cmpint().
* error.c (init_syserr): remove sys_nerr dependency.
* numeric.c (num_cmp): added to satisfy Comparable assumption.
* eval.c (rb_add_method): "initialize" should be public if it is a
singleton method.
* regex.c (re_match): avoid dereferencing if size == 0.
(ruby-bugs-ja:PR#360)
* time.c (time_cmp): should return nil if an operand is not a
number nor time. (ruby-bugs-ja:PR#359)
* file.c (rb_stat_cmp): should return nil if an operand is not
File::Stat.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
zipped with nil if argument arrays are shorter. if arrays are
longer, left items are ignored. now works with blocks.
* enum.c (zip_i): changed for new behavior.
* array.c (rb_ary_transpose): added. [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
variable table if it existes.
* class.c (rb_make_metaclass): metaclass of a metaclass is a
metaclass itself.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (rb_alias): prohibit making an alias named "allocate" if
klass is a metaclass.
* string.c (rb_string_value_ptr): StringValuePtr() should never
return NULL pointer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_find_file_ext): ditto.
* range.c (range_eq): class check should be based on range.class,
instead of Range to work with Range.dup.
* range.c (range_eql): ditto.
* class.c (rb_mod_dup): need to preserve metaclass and flags.
* object.c (rb_cstr_to_dbl): had a buffer overrun.
* marshal.c (w_class): integrate singleton check into a funciton
to follow DRY principle.
* marshal.c (w_uclass): should check singleton method.
* object.c (rb_obj_dup): dmark and dfree functions must be match
for T_DATA type.
* object.c (rb_obj_dup): class of the duped object must be match
to the class of the original.
* re.c (rb_reg_quote): do not escape \t, \f, \r, \n, for they are
not regular expression metacharacters.
* time.c (time_s_alloc): use time_free instead of free (null check,
also serves for type mark).
* time.c (time_s_at): check dfree function too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (rb_hash_dup): should preserve HASH_PROC_DEFAULT and
HASH_DELETED flags.
* hash.c (rb_hash_shift): shift from empty hash should not return
its default proc.
* hash.c (rb_hash_default_proc): new method. [new]
* array.c (rb_ary_aref): no need for Bignum check.
* array.c (rb_ary_aset): explicit Bignum check removd.
* numeric.c (fix_aref): normalize bignum before bit-op.
* bignum.c (rb_big_rand): max may be Bignum zero.
* bignum.c (rb_cstr_to_inum): should normalize bignums, to avoid
returning fixable bignum value.
* bignum.c (rb_uint2big): there should be no zero sized bignum.
* ext/extmk.rb.in: extmake() that works properly for both tkutil
(tk/tkutil.so) and digest/sha1.
* hash.c (rb_hash_equal): should check HASH_PROC_DEFAULT too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
substring, slice! should return nil without exception.
* array.c (rb_ary_insert): type fixed.
* string.c (rb_str_split_m): accept separator value nil as well.
* string.c (rb_str_become): was leaking memory.
* class.c (rb_include_module): should not alter other
classes/modules by inclusion. by this fix, local order may not
be preserved for some cases.
* class.c (include_class_new): module may be T_ICLASS; retrieve
original module information.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_mode_modenum): ditto.
* gc.c (rb_memerror): rename from mem_error, and exported.
* gc.c (Init_GC): pre-allocate NoMemoryError instance.
* object.c (convert_type): error message changed from "failed to
convert" to "cannot convert", since it does not try to convert
if an object does not respond to the converting method.
* eval.c (block_pass): convert Method to Proc using
rb_check_convert_type().
* object.c (rb_check_convert_type): always convert T_DATA
* eval.c (rb_thread_cleanup): should not terminate main_thread by
Fatal error.
* regex.c (is_in_list): need to not exclude NUL and NEWLINE.
* re.c (rb_reg_expr_str): wrong backslash escapement.
* re.c (rb_reg_expr_str): do not escape embedded space
characters.
* marshal.c (w_object): T_DATA process patch from Joel VanderWerf
<vjoel@PATH.Berkeley.EDU>. This is temporary hack; it remains
undocumented, and it will be removed when marshaling is
re-designed.
* marshal.c (r_object): ditto.
* numeric.c (num_step): Integer#step is moved to Numeric#step;
Fixnum#step is merged into this method.
* numeric.c (int_dotimes): Fixnum#times is merged.
* numeric.c (int_upto): Fixnum#upto is merged.
* numeric.c (int_downto): Fixnum#downto is merged.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
singleton cbase.
* eval.c (is_defined): adopt new cvar behavior.
* eval.c (rb_eval): ditto.
* eval.c (assign): ditto.
* class.c (rb_mod_clone): should not call rb_obj_clone(), since
Module does not provide "allocate".
* class.c (rb_singleton_class): should crate new singleton class
if obj is a class or module and attached object is different,
which means metaclass of singleton class is sought.
* time.c (time_s_alloc): now follows allocation framework.
* eval.c (rb_eval): should initialize outer class variables from
methods in singleton class definitions.
* eval.c (assign): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
only, no methods.
* eval.c (is_defined): should not dump core on defined?(a::b)
where a is not a class nor a module.
* object.c (Init_Object): remove dup and clone from TrueClass,
FalseClass, and NilClass.
* array.c (rb_ary_fill): Array#fill takes block to get the value to
fill.
* string.c (rb_str_to_i): to_i(0) auto-detects base radix.
* array.c (rb_ary_initialize): fill by the block evaluation value
if block is given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (rb_thread_cleanup): need not to free thread stacks at
process termination.
* array.c (rb_ary_fetch): use the block to get the default value
if the block is given.
* eval.c (rb_thread_schedule): should check time only if BOTH
WAIT_SELECT and WAIT_TIME.
* eval.c (umethod_bind): should update rklass field.
* hash.c (rb_hash_update): if a block is given, yields [key,
value1, value2] to the block to resolve conflict.
* string.c (rb_str_split_m): no need to consider KANJI
characters, if the length of separator is 1 (byte).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c (rb_mod_initialize): should accept zero argument.
* object.c (rb_mod_cmp): should raise ArgumentError if
inheritance/inclusion relation between two classes/modules is
not defined. [new]
* io.c (rb_io_fsync): new method. [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
NODE_SCLASS.
* gc.c (obj_free): need not to clear method cache on class/module
finalization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e