summaryrefslogtreecommitdiff
path: root/bignum.c
AgeCommit message (Collapse)Author
2003-01-18* bignum.c (rb_cstr_to_inum): should not erase all 0s, butnobu
squeeze into one. [ruby-dev:19377] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16-Wall cleanups (removed unused vars, no 'code has no effect' warnings)michal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3346 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-14* parse.y (list_append): avoid O(n) search using node->nd_next->nd_end.matz
* parse.y (list_append): ditto. * eval.c (rb_eval): NODE_ARRY nd_end adoption. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-19* numeric.c (num_step): use DBL_EPSILON.matz
* 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
2002-11-19* array.c (rb_ary_zip): iterates over items in the receiver.matz
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
2002-10-17* object.c (rb_str_to_dbl): RString ptr might be NULL.matz
* object.c (rb_cstr_to_dbl): p pointer might be NULL. * bignum.c (rb_str_to_inum): RString ptr might be NULL. * bignum.c (rb_cstr_to_inum): str pointer might be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-07* bignum.c (bigdivrem): bignum zero's len should not be 0.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-07* bignum.c (bigdivmod): wrong condition check for Bignum zero.matz
* bignum.c (Init_Bignum): need to add Bignum#div. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-04* bignum.c (rb_big_rshift): num should be initialized by carrymatz
bits if x is negative. * bignum.c (bigdivmod): len for bignum zero is 1, not 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21*.c: Int vs Long cleanupmichal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-19* array.c (sort_2): *a - *b may overflow.matz
* array.c (ary_new): len*sizeof(VALUE) may be a positive value. * array.c (rb_ary_initialize): ditto. * object.c (rb_class_allocate_instance): move singleton class check from rb_obj_alloc(). * re.c (rb_reg_initialize): should not modify frozen Regexp. * ext/tcltklib/tcltklib.c (ip_init): allocation framework. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-16* bignum.c (rb_cstr_to_inum): new decimal and octal string.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-13* hash.c (rb_hash_replace): should copy ifnone.matz
* 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
2002-08-12* bignum.c (rb_big_cmp): use dbl2big() for Floats, instead ofmatz
big2dbl(). * bignum.c (Init_Bignum): rb_big_zero_p() removed. There may be Bignum zero. * eval.c (rb_call0): new argument added for original method name. preserve original method name in frame->orig_func. * eval.c (is_defined): use frame->orig_func, not last_func. * eval.c (rb_eval): ditto. * eval.c (method_call): supply data->oid also to rb_call0(). * object.c (rb_class_allocate_instance): call rb_obj_alloc() when called from alias, thus invoke original "allocate". * eval.c (remove_method): removing allocate from classes should cause NameError. * hash.c (rb_hash_equal): should check default values. * ext/socket/socket.c (s_recvfrom): update RSTRING len. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-12* bignum.c (rb_big_cmp): raise for NaN. (ruby-bugs-ja:PR#284).nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-26* random.c: replace with Mersenne Twister RNG.matz
* eval.c (jump_tag_but_local_jump): preserve retval in LocalJumpError exceptions. * parse.y (command): no more check for "super outside of method". * eval.c (rb_mod_define_method): should set last_class and last_func in the block->frame. * eval.c (error_handle): should handle TAG_THROW as well. * parse.y (yylex): new decimal notation '0d4567'. * parse.y (yylex): new octal notation '0o777'. * parse.y (string_content): every string_content node should return string only. use NODE_EVSTR to coercing. * eval.c (rb_eval): NODE_EVSTR support. * re.c (rb_reg_quote): avoid unnecessary string allocation. * string.c (get_pat): quote metachracters before compiling a string into a regex. * string.c (rb_str_split_m): special treatment of strings of size 1, but AWK emulation. now uses get_pat(). * string.c (rb_str_match_m): quote metacharacters. * string.c (rb_str_match2): ditto. * ext/socket/socket.c (sock_addrinfo): make all 3 versions of getaddrinfo happy. [ruby-core:00184] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-18unused variable.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-18* parse.y (yylex): obsolete '?<whitespace>'; use '?\s', '?\n',matz
etc, instead. * parse.y (yylex): no here document after a dot. * parse.y (yylex): should have set lex_state after '`'. * parse.y (yylex): should have set lex_state properly after tOP_ASGN. * bignum.c (rb_big2dbl): return canonical HUGE_VAL for infinity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-11* eval.c (rb_eval): ruby_frame->last_func may be null, if it'smatz
called outside of a method. * parse.y (arg): use INT2NUM, not INT2FIX for tUMINUS. * parse.y (arg): unnecessary negative tPOW treatment. * parse.y (tokadd_escape): wrong backslash escapement. * parse.y (stmt,arg): too much void value check. * parse.y (stmt,arg): need to check void value on rules which does not use node_assign(). * ext/socket/socket.c (ipaddr): need not to taint hostnames. * range.c (range_include): should be based on "<=>", whereas member? still is based on "each". * range.c (range_min,range_max): redefine methods based on "<=>". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-14* eval.c (rb_clear_cache_by_class): new function.matz
* eval.c (set_method_visibility): should have clear cache forq updated visibility. * numeric.c (flo_to_s): default format precision to be "%.16g". * util.c (ruby_strtod): use own strtod(3) implementation to avoid locale hell. Due to this change "0xff".to_f no longer returns 255.0 * eval.c (avalue_to_yvalue): new function to distinguish yvalue (no-arg == Qundef) from svalue (no-arg == Qnil). * eval.c (rb_yield_0): use avalue_to_yvalue(). * eval.c (assign): warn if val == Qundef where it means rhs is void (e.g. yield without value or call without argument). * parse.y (value_expr): need not to warn for WHILE and UNTIL, since they can have return value (via valued break). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-18* re.c (rb_reg_expr_str): should treat backslash specially inmatz
escaping. * io.c: complete off_t handling; missing argument for fptr_finalize(); polished rb_scan_args call. * dir.c: wrap multi-statment macro by do { } while (0) * eval.c, numeric,c, sprintf.c, util.c: ditto. * bignum.c (rb_big_eq): check `y == x' if y is neither Fixnum, Bignum, nor Float. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-10* variable.c (rb_obj_remove_instance_variable): raise NameError ifmatz
specified instance variable is not defined. * variable.c (generic_ivar_remove): modified to check ivar existence. * file.c (rb_file_s_extname): new method based on the proposal (and patch) from Mike Hall. [new] * eval.c (error_handle): default to 1 unless status is set. * eval.c (ruby_options): guard error_handle() with PROT_NONE. * eval.c (ruby_stop): ditto. * math.c (math_acosh): added. [new] * math.c (math_asinh): ditto. * math.c (math_atanh): ditto. * struct.c (rb_struct_each_pair): method added. [new] * class.c (rb_singleton_class): wrong condition; was creating unnecessary singleton class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-26* bignum.c (rb_quad_pack): get rid of escape sequences.eban
* dln.c (dln_load, __VMS): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-22* the VMS support patch submitted by Akiyoshi, Masamichimatz
<Masamichi.Akiyoshi@jp.compaq.com> is merged. * eval.c (exec_under): changing ruby_class is OK, but should not alter cbase. * eval.c (yield_under_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-15* bignum.c, intern.h (rb_ull2big, rb_ll2big, rb_ull2inum, rb_ll2inum,usa
big2ull, rb_big2ull, rb_big2ll): use LONG_LONG macro instead of long long. * numeric.c, intern.h, ruby.h (rb_num2ll, rb_num2ull): ditto. * ruby.h: use _I64_MAX and _I64_MIN if they are defined (for VC++). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-14* re.c (rb_reg_match): should clear $~ if operand is nil.matz
* re.c (rb_reg_match2): ditto. * configure: merge Jonathan Baker's large file support patch [ruby-talk:35316], with read_all patch in [ruby-talk:35470]. * eval.c (rb_f_abort): optional message argument that be printed on termination. [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-26* bignum.c (rb_big_2comp): void function cannot return any value.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-22* bignum.c (get2comp): need to specify to carry or not.matz
* io.c (rb_io_inspect): embed path info. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-15* bignum.c (rb_big_rshift): should properly convert the nagativematz
value to 2's compliment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-13* bignum.c: forget to check in DIGSPERLONGLONG.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-13* parse.y (stmt): local variable declaration order was changedmatz
since 1.6 * parse.y (arg): ditto. * pack.c (pack_pack): add templates 'q' and 'Q'. * pack.c (pack_unpack): ditto. * bignum.c (rb_quad_pack): new utility function. * bignum.c (rb_quad_unpack): ditto. * parse.y (assignable): should emit CVASGN within the method body. * dir.c (dir_s_glob): should not warn even if no match found. * eval.c (rb_eval): clean up class variable behavior. * eval.c (assign): ditto. * eval.c (is_defined): ditto. * variable.c (rb_mod_class_variables): need not to call rb_cvar_singleton(). * variable.c (rb_cvar_singleton): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-01* intern.h: prototypes for new functions; rb_cstr_to_inum(),nobu
rb_str_to_inum(), rb_cstr_to_dbl(), rb_str_to_dbl() * bignum.c (rb_cstr_to_inum): changed from rb_cstr2inum(), and added argument badcheck to be consistent with parser. [new] * bignum.c (rb_str_to_inum): ditto. * bignum.c (rb_cstr2inum): wapper of rb_cstr_to_inum() now. * bignum.c (rb_str2inum): ditto. * object.c (rb_cstr_to_dbl): float number parser. [new] * object.c (rb_str_to_dbl): ditto. * object.c (rb_Float): use rb_cstr_to_dbl() for strict check. * object.c (rb_Integer): use rb_str_to_inum() for strict check. * string.c (rb_str_to_f): use rb_str_to_dbl() with less check. * string.c (rb_str_to_i): use rb_str_to_inum() with less check. * string.c (rb_str_hex): ditto. * string.c (rb_str_oct): ditto. * sprintf.c (rb_f_sprintf): ditto. * time.c (obj2long): ditto. * parse.y (yylex): use rb_cstr_to_inum() for strict check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-16* object.c (rb_Float): remove underscores between digits.nobu
* bignum.c (rb_cstr2inum): reject prefix followed by spaces only. * class.c (rb_class_inherited): should use Object when no super class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-11* re.c (match_select): should propagate taintness.matz
* hash.c (rb_hash_set_default): Hash#default= should return the new value. * string.c (rb_str_to_i): accepts optional base argument. [new] * numeric.c (rb_fix2str): should not handle negative fixnum values int32 via calling sprintf() directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-04* process.c (rb_f_system): abandon vfork.matz
* io.c (pipe_open): ditto. * defines.h: sparc linux needs different FLUSH_REGISTER_WINDOWS * regex.c (re_search): abandon stclass optimization. * bignum.c (rb_cstr2inum): deny "0_". * bignum.c (rb_cstr2inum): allow "0\n" and so on. * error.c (rb_invalid_str): utility function to show inspect()'ed string. * bignum.c (rb_cstr2inum): prints invalid strings in inspect()'ed format. * object.c (rb_Float): ditto. * object.c (rb_convert_type): no longer use rb_rescue(). * re.c (rb_reg_search): initialize taint status of match object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-27* bignum.c (rb_cstr2inum): deny "0_".nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-26* bignum.c (rb_cstr2inum): allow "0\n" and so on.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-19* parse.y (parse_regx): should raise error on untermitatedmatz
expression interpolation. * pack.c (pack_unpack): should give length to utf8_to_uv(). * pack.c (utf8_to_uv): add length check. * massages: replace "wrong #" by "wrong number". * marshal.c (w_float): output Infinity and NaN explicitly. * marshal.c (r_object): support new explicit float format. * eval.c (rb_thread_wait_for): select may cause ERESTART on Solaris. * eval.c (rb_thread_select): ditto. * array.c (rb_ary_join): dumped core if sep is not T_STRING nor T_NIL. * array.c (rb_ary_join): buffer size calculattion was wrong. * array.c (rb_ary_to_s): if rb_output_fs is nil, insert newlines between array elements (use rb_default_rs as newline litral) [experimental]. * gc.c (init_mark_stack): no need to clear mark_stack. * gc.c (gc_mark_all): need to handle finalizer mark. * gc.c (gc_mark_rest): use MEMCPY instead of memcpy. * gc.c (rb_gc_mark): earlier const check to avoid pusing special constants into mark stack. * numeric.c (fix_to_s): 'to_s' now takes optional argument to specify radix. [new] * bignum.c (rb_big_to_s): ditto. [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-08* process.c (security): always give warning for insecure PATH.matz
* dir.c (my_getcwd): do not rely on MAXPATHLEN. * file.c (rb_file_s_readlink): ditto. * file.c (path_check_1): ditto. * eval.c (rb_yield_0): should not call rb_f_block_given_p(). * string.c (rb_str_chomp_bang): should terminate string by NUL. * eval.c (rb_yield_0): better error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-01* bignum.c (rb_big_aref): idx may be a Bignum.matz
* numeric.c (fix_aref): negative index must return zero. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-30* string.c (rb_str_chomp_bang): do smart chomp if $/ == '\n'.matz
* io.c (rb_io_puts): don't treat Array specially. * bignum.c (rb_big_cmp): should convert bignum to float. * eval.c (rb_f_eval): can't modify untainted binding. * regex.c (re_compile_pattern): should preverve p0 value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-29* parse.y (str_extend): shuould allow interpolation of $-x.matz
* variable.c (rb_cvar_set): empty iv_tbl may cause infinite loop. * variable.c (rb_cvar_get): ditto. * variable.c (cvar_override_check): ditto. * bignum.c (rb_big_eq): convert Bignum to Float, instead of reverse. * time.c (time_localtime): getting tm should not be prohibited for frozen time objects. * time.c (time_gmtime): ditto. * version.c (Init_version): freeze RUBY_VERSION, RUBY_RELEASE_DATE, and RUBY_PLATFORM. * file.c (Init_File): freeze File::SEPARATOR, ALT_SEPARATOR and PATH_SEPARATOR. * file.c (rb_stat_cmp): should check operand type before calling get_stat(). * eval.c (rb_eval_cmd): should not invoke "call" with a block on any occasion. * numeric.c (fix_aref): idx may be a Bignum. * numeric.c (num_remainder): a bug in Numeric#remainder. * eval.c (rb_exec_end_proc): END might be called within END block. * class.c (rb_mod_clone): should not copy class name, since clone should remain anonymous. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-29* parse.y (yylex): ternary ? can be followed by newline.matz
* eval.c (rb_f_require): should check static linked libraries before raising exception. * array.c (rb_ary_equal): check identiry equality first. * string.c (rb_str_equal): ditto. * struct.c (rb_struct_equal): ditto. * numeric.c (Init_Numeric): undef Integer::new. * eval.c (rb_eval): NODE_WHILE should update result for each conditional evaluation. * eval.c (rb_eval): NODE_UNTIL should return last evaluated value (or value given to break). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-13* bignum.c, marshal.c: Detypo: s/SIZEOF_ING/SIZEOF_INT/.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-31* marshal.c (Init_marshal): new constant Marshal::MAJOR_VERSIONmatz
and Marshal::MINOR_VERSION. * marshal.c (marshal_load): ruby_verbose test should be wrapped by RTEST(). * hash.c (rb_hash_index): should return nil (not the default value) if value is not in the hash. * numeric.c (num_div): new method added. alias to '/' which should be preserved even if '/' is redefined (e.g. by mathn). [new] * bignum.c (rb_cstr2inum): "0 ff".hex should return 0, not 255. * file.c (rb_file_s_expand_path): fixed using CharNext(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-05-21* bignum.c (rb_big2str): t should be protected from GC.matz
* process.c (rb_proc_times): need not to check retrun value from times(2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-05-11* bignum.c (bigdivrem): access boundary bug.matz
* marshal.c (w_object): prohibit dumping out singleton classes. * object.c (rb_mod_to_s): distinguish singleton classes. * variable.c (rb_class2name): it's ok to reveal NilClass, TrueClass, FalseClass. * eval.c (rb_yield_0): preserve and restore ruby_cref as well. * eval.c (is_defined): core dumped during instance_eval for special constants. * eval.c (rb_eval): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-05-06forgot some checkins.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-05-02* eval.c (block_pass): should not downgrade safe level.matz
* ext/dbm/extconf.rb: allow specifying dbm-type explicitly. * ext/dbm/extconf.rb: avoid gdbm if possible, because it leaks memory, whereas gdbm.so doesn't. potential incompatibility. * string.c (rb_str_insert): new method. * parse.y (yylex): lex_state after RESCUE_MOD should be EXPR_BEG. * array.c (rb_ary_insert): new method. * array.c (rb_ary_update): new utility function. * io.c (set_outfile): should check if closed before assignment. * eval.c (rb_eval): should preserve value of ruby_errinfo. * eval.c (rb_thread_schedule): infinite sleep should not cause dead lock. * array.c (rb_ary_flatten_bang): proper recursive detection. * eval.c (yield_under): need not to prohibit at safe level 4. * pack.c (pack_pack): p/P packs nil into NULL. * pack.c (pack_unpack): p/P unpacks NULL into nil. * pack.c (pack_pack): size check for P template. * ruby.c (set_arg0): wrong predicate when new $0 value is bigger than original space. * gc.c (id2ref): should use NUM2ULONG() * object.c (rb_mod_const_get): check whether name is a class variable name. * object.c (rb_mod_const_set): ditto. * object.c (rb_mod_const_defined): ditto. * marshal.c (w_float): precision changed to "%.16g" * eval.c (rb_call0): wrong retry behavior. * numeric.c (fix_aref): a bug on long>int architecture. * eval.c (rb_eval_string_wrap): should restore ruby_wrapper. * regex.c (re_compile_pattern): char class at either edge of range should be invalid. * eval.c (handle_rescue): use === to compare exception match. * error.c (syserr_eqq): comparison between SytemCallErrors should based on their error numbers. * eval.c (safe_getter): should use INT2NUM(). * bignum.c (rb_big2long): 2**31 cannot fit in 31 bit long. * regex.c (calculate_must_string): wrong length calculation. * eval.c (rb_thread_start_0): fixed memory leak. * parse.y (none): should clear cmdarg_stack too. * io.c (rb_fopen): use setvbuf() to avoid recursive malloc() on some platforms. * file.c (rb_stat_dev): device functions should honor stat field types (except long long such as dev_t). * eval.c (rb_mod_nesting): should not push nil for nesting array. * eval.c (rb_mod_s_constants): should not search array by rb_mod_const_at() for nil (happens for singleton class). * class.c (rb_singleton_class_attached): should modify iv_tbl by itself, no longer use rb_iv_set() to avoid freeze check error. * variable.c (rb_const_get): error message "uninitialized constant Foo at Bar::Baz" instead of "uninitialized constantBar::Baz::Foo". * eval.c (rb_mod_included): new hook called from rb_mod_include(). * io.c (opt_i_set): should strdup() inplace_edit string. * eval.c (exec_under): need to push cref too. * eval.c (rb_f_missing): raise NameError for "undefined local variable or method". * error.c (Init_Exception): new exception NoMethodError. NameError moved under ScriptError again. * eval.c (rb_f_missing): use NoMethodError instead of NameError. * file.c (Init_File): should redifine "new" class method. * eval.c (PUSH_CREF): sharing cref node was problematic. maintain runtime cref list instead. * eval.c (rb_eval): copy defn node before registering. * eval.c (rb_load): clear ruby_cref before loading. * variable.c (rb_const_get): no recursion to show full class path for modules. * eval.c (rb_set_safe_level): should set safe level in curr_thread as well. * eval.c (safe_setter): ditto. * object.c (rb_obj_is_instance_of): nil belongs to false, not true. * time.c (make_time_t): proper (I hope) daylight saving time handling for both US and Europe. I HATE DST! * eval.c (rb_thread_wait_for): non blocked signal interrupt should stop the interval. * eval.c (proc_eq): class check aded. * eval.c (proc_eq): typo fixed ("return" was ommitted). * error.c (Init_Exception): move NameError under StandardError. * class.c (rb_mod_clone): should copy method bodies too. * bignum.c (bigdivrem): should trim trailing zero bdigits of remainder, even if dd == 0. * file.c (check3rdbyte): safe string check moved here. * time.c (make_time_t): remove HAVE_TM_ZONE code since it sometimes reports wrong time. * time.c (make_time_t): remove unnecessary range check for platforms where negative time_t is available. * process.c (proc_waitall): should push Process::Status instead of Finuxm status. * process.c (waitall_each): should add all entries in pid_tbl. these changes are inspired by Koji Arai. Thanks. * process.c (proc_wait): should not iterate if pid_tbl is 0. * process.c (proc_waitall): ditto. * numeric.c (flodivmod): a bug in no fmod case. * process.c (pst_wifsignaled): should apply WIFSIGNALED for status (int), not st (VALUE). * io.c (Init_IO): value of $/ and $\ are no longer restricted to strings. type checks are done on demand. * class.c (rb_include_module): module inclusion should be check taints. * ruby.h (STR2CSTR): replace to StringType() and StringTypePtr(). * ruby.h (rb_str2cstr): ditto. * eval.c (rb_load): should not copy topleve local variables. It cause variable/method ambiguity. Thanks to L. Peter Deutsch. * class.c (rb_include_module): freeze check at first. * eval.c (rb_attr): sprintf() and rb_intern() moved into conditional body. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e