* re.c (rb_reg_initialize_m): frozen check should be moved here
from rb_reg_initialize().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* marshal.c (r_bytes0): check if successfully read, use
rb_io_fread() instead of fread() to be preemptive.
(ruby-bugs-ja:PR#294, 295)
* rubyio.h (rb_io_fread): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (ChildRecord, FindFreeChildSlot): ditto.
* win32/win32.c, win32/win32.h (pipe_exec): new function for two-way
pipe support for win32.
* win32/win32.c, win32/win32.h (FindPipedChildSlot, rb_w32_popen,
rb_w32_pclose): removed functions for two-way pipe support for win32.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c (proc_options): access prefixed "ruby_yydebug".
* applied modifies to pacify some of gcc -Wall warnings.
* parse.y (arg): no more ugly hack for "**", so that "-2**2" to be
parsed as "(-2)**2", whereas "- 2**2" or "-(2)**2" to be parsed
as "-(2**2)".
* parse.y (yylex): '-2' to be literal fixnum. [new]
* time.c (time_succ): new method for Range support.
* time.c (time_arg): nil test against v[6] (usec).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_s_sysopen): new method to get a raw file
descriptor. [new]
* ext/socket/socket.c (tcp_sysaccept): new method to return an
accepted socket fd (integer). [new]
* ext/socket/socket.c (unix_sysaccept,sock_sysaccept): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2492 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
byte unit.
* error.c (exc_initialize): should clear backtrace information.
* io.c (rb_io_fptr_cleanup): should close IO created by IO.new(fd).
* rubyio.h: remove FMODE_FDOPEN
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (io_write): check error if written data is less than
specified size to detect EPIPE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_fptr_cleanup): do not close IO created by for_fd().
* io.c (rb_io_initialize): mark IO created by for_fd
* ext/socket/socket.c (bsock_s_for_fd): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
A Zagorodnikov <xm@bolotov-team.ru>. [new]
* io.c (READ_DATA_PENDING): use !feof(fp) for default behavior.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
allowed when $SAFE > 3.
* eval.c (rb_thread_ready): THREAD_TO_KILL threads should not turn
into THREAD_RUNNABLE on wakeup.
* eval.c (rb_thread_list): THREAD_TO_KILL threads should be in the
list.
* eval.c (thgroup_list): ditto; by moving gid clearance from
rb_thread_cleanup().
* dir.c (fnmatch): "*/bar" (with FNM_PATHNAME flag) does not
match "foo/bar".
* io.c (read_all): files on /proc filesystem with zero stat size,
may have contents.
* ext/socket/socket.c (tcp_s_gethostbyname): refactored.
* ext/socket/socket.c (sock_s_gethostbyname): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
<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
* 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
* eval.c (remove_method): should not remove a empty method to
implement "undef".
* eval.c (rb_eval): should allow singleton class def for
true/false/nil.
* parse.y (str_extend): backslash escape was done wrong.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (fptr_finalize): do not raise error on EBADF if write
buffer is empty.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_each_line): ditto.
* io.c (argf_getline): ditto.
* process.c: should include <time.h> to get proper CLK_TCK.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (method_inspect): proper output format to distinguish
methods and singleton methods.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2046 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
* signal.c (install_sighandler): do not install sighandler unless
the old value is SIG_DFL.
* io.c (io_write): should not raise exception on O_NONBLOCK io.
* dir.c (dir_set_pos): seek should return dir, pos= should not.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
method.
* io.c (rb_io_s_open): open should call initialize too. IO#for_fd
also calls initialize. [new]
* error.c (rb_sys_fail): replace INT2FIX() by INT2NUM() since
errno value may not fit in Fixnum size on Hurd.
* error.c (set_syserr): ditto.
* dir.c (dir_s_glob): returns nil if block given.
* io.c (rb_io_each_byte): should return self.
* io.c (rb_io_close_m): close check added.
* dir.c (dir_seek): should return pos.
* parse.y (fixpos): orig may be (NODE*)1, which should not be
dereferenced.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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
* 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
default method visibility.
* eval.c (rb_attr): should warn if the default method visibility
is "module_function" (can be error).
* eval.c (rb_mod_define_method): should define class/module method
also if the visibility is "module_function".
* eval.c (rb_mod_define_method): should call hook method
"method_added", and "singleton_method_added".
* string.c: use RESIZE_CAPA for capacity change.
* ext/socket/socket.c (Init_socket): add listen method to
TCPServer and UNIXServer.
* ext/socket/socket.c (bsock_send): should raise EWOULDBLOCK
exception.
* ext/socket/socket.c (s_recvfrom): ditto.
* ext/socket/socket.c (s_accept): ditto.
* ext/socket/socket.c (udp_send): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
modifying buffer is shared.
* array.c (ary_make_shared): make an internal buffer of an array
to be shared.
* array.c (rb_ary_shift): avoid sliding an internal buffer by
using shared buffer.
* array.c (rb_ary_subseq): avoid copying the buffer.
* parse.y (gettable): should freeze __LINE__ string.
* io.c (rb_io_puts): old behavoir restored. rationale: a) if you
want to call to_s for arrays, you can just call print a, "\n".
b) to_s wastes memory if array (and sum of its contents) is
huge. c) now any object that has to_ary is treated as an array,
using rb_check_convert_type().
* hash.c (rb_hash_initialize): now accepts a block to calculate
the default value. [new]
* hash.c (rb_hash_aref): call "default" method to get the value
corrensponding to the non existing key.
* hash.c (rb_hash_default): get the default value based on the
block given to 'new'. Now it takes an optinal "key" argument.
"default" became the method to get the value for non existing
key. Users may override "default" method to change the hash
behavior.
* hash.c (rb_hash_set_default): clear the flag if a block is given
to 'new'
* object.c (Init_Object): undef Data.allocate, left Data.new.
* ext/curses/curses.c (window_scrollok): use RTEST().
* ext/curses/curses.c (window_idlok): ditto.
* ext/curses/curses.c (window_keypad): ditto.
* ext/curses/curses.c (window_idlok): idlok() may return void on
some platforms; so don't use return value.
* ext/curses/curses.c (window_scrollok): ditto for consistency.
* ext/curses/curses.c: replace FIX2INT() by typechecking NUM2INT().
* parse.y (str_extend): should not process immature #$x and
#@x interpolation, e.g #@#@ etc.
* enum.c (enum_sort_by): sort_by does not have to be stable always.
* enum.c (enum_sort_by): call qsort directly to gain performance.
* util.c (ruby_qsort): ruby_qsort(qs6) is now native thread safe.
* error.c (rb_sys_fail): it must be a bug if it's called when
errno == 0.
* regex.c (WC2MBC1ST): should not pass through > 0x80 number in UTF-8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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
* 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
* parse.y (yylex): should support 'keyword='.
* ruby.c (proc_options): should not adjust argc/argv if -e option
is supplied.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c (set_arg0): long strings for $0 dumped core.
* ruby.c (set_arg0): use setprogtitle() if it's available.
* io.c (rb_io_popen): accept integer flags as mode.
* file.c (rb_find_file_ext): extension table can be supplied from
outside. renamed.
* eval.c (rb_f_require): replace rb_find_file_noext by
rb_find_file_ext.
* eval.c (rb_provided): should also check feature without
extension.
* numeric.c (flo_to_s): do not rely on decimal point to be '.'
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (umethod_bind): recv can be an instance of descender of
oklass if oklass is a Module.
* hash.c (rb_hash_equal): check identiry equality first.
* file.c (group_member): should check real gid only.
* file.c (eaccess): do not cache euid, since effective euid may be
changed via Process.euid=().
* file.c (eaccess): return -1 unless every specified access mode
is permitted.
* eval.c (rb_eval): while/until returns the value which is given
to break.
* parse.y (value_expr): using while/until/class/def as an
expression is now gives a warning, not an error.
* range.c (range_eqq): should compare strings based on magical
increment (using String#upto), not dictionary order.
* enum.c (enum_sort_by): new method for Schewartzian transformed
stable sort.
* variable.c (mod_av_set): detect constant overriding for built-in
classes/modules.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_rstrip_bang): new method.
* string.c (rb_str_associate): should consider STR_ASSOC too.
* eval.c (rb_undefined): do not recurse if method_missing is
undefined.
* process.c (proc_waitpid): now all arguments are optional.
* process.c (Init_process): waitpid is now alias to wait.
* process.c (Init_process): waitpid2 is now alias to wait2.
* process.c (rb_waitpid): made public.
* ext/pty/pty.c (pty_getpty): avoid disturbing SIGCHLD using
thread and rb_waitpid.
* process.c (proc_getpgrp): now takes no argument on all
platforms.
* process.c (proc_setpgrp): ditto.
* ext/socket/socket.c (sock_s_pack_sockaddr_in): added
Socket::pack_sockaddr_in(). [new]
* ext/socket/socket.c (sock_s_pack_sockaddr_un): added
Socket::pack_sockaddr_un(). [new]
* ext/socket/socket.c (sock_s_pack_sockaddr_in): added
Socket::unpack_sockaddr_in(). [new]
* ext/socket/socket.c (sock_s_pack_sockaddr_un): added
Socket::unpack_sockaddr_un(). [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
loading.
* io.c (io_fread): use fread(3) if PENDING_COUND is available.
* class.c (rb_mod_include_p): Module#include? added. [new]
* re.c (ignorecase_setter): give warning on modifying $=.
* string.c (rb_str_casecmp): new method. [new]
* string.c (rb_str_eql): separated from rb_str_equal(), make it
always be case sensitive. [new]
* string.c (rb_str_hash): made it always be case sensitive.
* eval.c (rb_f_require): should not include path in $" value
* file.c (rb_find_file): should return 0 explicitly on failure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c (dir_s_chdir): warn only when invoked from multiple
threads or block is not given.
* object.c (rb_convert_type): should use rb_rescue(), not rb_rescue2().
* range.c (range_init): ditto.
* object.c (rb_obj_dup): should free generic_ivar if original owns
them.
* string.c (rb_str_each_line): should propagate taint mark.
* ext/nkf/nkf.c (rb_nkf_kconv): ditto.
* eval.c (rb_f_require): revamp for simpler implementation.
* file.c (rb_find_file_noext): use String object, instead of
passing char* around.
* file.c (rb_find_file): ditto.
* dln.c (dln_load): should use NSLINKMODULE_OPTION_BINDNOW.
* ruby.c (load_file): local variables 'c' remain uninitialized on
xflag.
* regex.c (re_match): prefetched escaped character too early.
* eval.c (rb_call0): add argument check for attr_readers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
time. previous behavior (search ".rb", then ".so") has a
security risk (ruby-bugs#PR140).
* array.c (rb_ary_to_ary): new function to replace internal
rb_Array(), which never calls to_a, but to_ary (rb_Array() might
call both). [new]
* regex.c (PUSH_FAILURE_POINT): push option status again.
* regex.c (re_compile_pattern): avoid pushing unnecessary
option_set.
* eval.c (rb_load): tainted string is OK if wrapped *and*
$SAFE >= 4.
* eval.c (rb_thread_start_0): should not nail down higher blocks
before preserving original context (i.e. should not alter
original context).
* eval.c (proc_yield): new method equivalent to Proc#call but no
check for number of arguments. [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
data. [new]
* variable.c (rb_mod_const_of): ditto.
* variable.c (rb_const_list): new function to convert internal
data (hash table) to array of strings.
* eval.c (rb_mod_s_constants): data handling scheme has changed.
* eval.c (rb_add_method): should not call rb_secure(), for
last_func may not be set.
* io.c (rb_io_ctl): ioctl should accept any integer within C long
range.
* marshal.c (r_object): wrong type check for modules.
* marshal.c (w_object): should not dump anonymous classes/modules.
* io.c (rb_open_file): use rb_file_sysopen_internal() if the 3rd
argument (permission flags) is given. [new, should be backported?]
* io.c (rb_io_mode_binmode): mode string (e.g. "r+") to flags to
open(2).
* eval.c (rb_eval): NODE_REXPAND expand an array of 1 element as
the element itself. [new, should be backported?]
* parse.y (ret_args): should treat "*[a]" in rhs expression as
"a", not "[a]".
* regex.c (re_compile_pattern): should push option modifier at the
right place.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_or): ditto.
* eval.c (rb_thread_schedule): should save context before raising
deadlock, saved context for current thread might be obsolete.
* time.c (make_time_t): non DST timezone shift supported (hopefully).
* time.c (make_time_t): strict range detection for negative time_t.
* signal.c: SIGINFO added.
* eval.c (rb_ensure): should not SEGV when prot_tag is NULL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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
value is ignored.
* class.c (rb_singleton_class_clone): should copy class constant
table as well.
* class.c (rb_include_module): sometimes cache was mistakenly left
uncleared - based on the patch by K.Kosako.
* ruby.h: all Check_SafeStr()'s are replaced by SafeStr() to
ensure 'to_str' be always effective.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_file_flock): do not trap EINTR.
* missing/flock.c (flock): returns the value from lockf(2)
directly.
* eval.c (ev_const_defined): should ignore toplevel cbase (Object).
* eval.c (ev_const_get): ditto.
* ext/md5/md5.h: replace by independent md5 implementation
contributed by L. Peter Deutsch (thanks).
* ext/md5/md5init.c: adopted to Deutsch's md5 implementation.
* pack.c (pack_unpack): string from P/p should be tainted.
* ext/curses/curses.c: curses on Mac OS X public beta does not
have _maxx etc.
* marshal.c (w_object): should truncate trailing zero short for
bignums.
* object.c (sym_intern): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (cond0): no special treatment of string literal in
condition.
* math.c: add acos, asin, atan, conh, sinh, tanh and hypot to Math.
* configure.in: check hypot availablility.
* missing/hypot.c: public domain rewrite of hypot.
* parse.y (warn_unless_e_option): warning condition was wrong.
* parse.y (warning_unless_e_option): ditto.
* enum.c (enum_all): new method 'all?', which returns true if
block returns true for all elements.
* enum.c (enum_any): new method 'any?', which returns true if
block retruns true for any of elements.
* marshal.c (marshal_load): do not give warning unless explicitly
set to verbose.
* eval.c (rb_exit): give string value "exit" to SystemExit.
* ruby.c (proc_options): -v should not print version if
proc_options called via moreswitches().
* parse.y (stmt): while/until modifier must work for empty body.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
based on ruby_frame->iter altered by PUSH_ITER().
* eval.c (rb_thread_fd_close): should save current context before
raising exception.
* io.c (set_stdin): preserve original stdin.
* io.c (set_outfile): preserve original stdout/stderr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/socket/socket.c (tcp_s_open): should not give default value
to local_host.
* time.c (time_s_times): move to Process::times.
* file.c (rb_file_s_lchmod): new method File::lchmod.
* file.c (rb_file_s_lchown): new method File::lchown.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
have same fileno.
* eval.c (rb_load): raise LocaJumpError if unexpected local jumps
appear during load.
* ext/socket/socket.c (bsock_close_read): don't call rb_thread_fd_close();
it's supposed to be called by io_io_close().
* ext/socket/socket.c (bsock_close_read): do not modify f and f2.
* ext/socket/socket.c (bsock_close_write): ditto.
* ext/socket/socket.c (sock_new): avoid dup(2) on sockets.
* parse.y (primary): preserve and clear in_single and in_def using
stack to prevent nested method errors in singleton class bodies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
less than 2.
* eval.c (POP_VARS): propagate DVAR_DONT_RECYCLE, if
SCOPE_DONT_RECYCLE of ruby_scope is set.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
pathname. In addition, it accepts third optional argument to
specify starting point.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* pack.c (pack_unpack): should check associated pointer packed by
pack("P"). restriction added.
Sun Jan 14 21:49:28 2001 Koji Arai <JCA02266@nifty.ne.jp>
* sprintf.c (rb_f_sprintf): simple typo. binary base should be 2,
not '2'.
* re.c (rb_reg_s_last_match): should explicitly return nth match.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
which included commits to RCS files with non-trunk default branches.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
which included commits to RCS files with non-trunk default branches.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12 b2dd03c8-39d4-4d8f-98ff-823fe69b080e