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
* 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
* parse.y (rb_compile_file): no longer need to strdup() here.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1952 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
* process.c (pst_wstopsig): returns nil unless WIFSTOPPED() is
non-zero.
* process.c (pst_wtermsig): returns nil unless WIFSIGNALED() is
non-zero.
* process.c (pst_wexitstatus): returns nil unless WIFEXITED() is
non-zero.
* eval.c (rb_thread_select): tv_sec and tv_usec should not be
negative.
* signal.c (posix_signal): do not set SA_RESTART for SIGVTALRM.
* parse.y (call_args2): block_arg may follow the first argument in
call_args2.
* eval.c (stack_check): should avoid stack length check during
raising SystemStackError exception.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
on Guy Decoux's patch in [ruby-talk:25478].
* string.c (rb_str_succ): there was buffer overrun.
* parse.y (str_extend): term can be any character.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
POSIX_SIGNAL is defined.
* eval.c (error_print): errat array may be empty.
* eval.c (rb_eval_cmd): should not upgrade safe level unless
explicitly specified by argument newly added.
* signal.c (sig_trap): should not allow tainted trap closure.
* variable.c (rb_f_trace_var): should not allow trace_var on safe
level higher than 3.
* variable.c (rb_f_trace_var): should not allow tainted trace
closure.
* gc.c: do not use static stack until system stack overflows.
* eval.c (eval): should call Exception#exception instead of
calling rb_exc_new3() directly.
* error.c (exc_exception): set "mesg" directly to the clone. it
might be better to set mesg via some method for flexibility.
* variable.c (cvar_override_check): should print original module
name, if 'a' is T_ICLASS.
* parse.y (yylex): float '1_.0' should not be allowed.
* variable.c (var_getter): should care about var as Qfalse
(ruby-bugs#PR199).
* array.c (cmpint): <=> or block for {min,max} may return bignum.
* array.c (sort_1): use rb_compint.
* array.c (sort_2): ditto.
* enum.c (min_ii): ditto.
* enum.c (min_ii): ditto.
* enum.c (max_i): ditto.
* enum.c (max_ii): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1827 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
* numeric.c (num_clone): Numeric should not be copied by clone.
* object.c (rb_obj_clone): should check immediate values.
* parse.y (command): `yield' should take command_args.
* parse.y (parse_quotedwords): %w(...) is not a string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/socket/socket.c (unix_peeraddr): getpeername(2) may result
len = 0.
* string.c (rb_str_subpat_set): support function for new argument
pattern String#[re,offset] = val. [new]
* eval.c (POP_BLOCK): rb_gc_force_recycle() was called too much.
Should not be called if SCOPE_DONT_RECYCLE is set.
* string.c (rb_str_aref_m): new argument pattern
String#[re,offset]. [new]
* string.c (rb_str_substr): should return an instance of
receiver's class.
* string.c (rb_str_succ): ditto.
* array.c (rb_ary_subseq): ditto.
* array.c (rb_ary_initialize): Array.new([1,2,3]) => [1,2,3]. [new]
* string.c (rb_str_reverse): should return an instance of
receiver's class.
* string.c (rb_str_times): ditto.
* array.c (rb_ary_times): ditto
* string.c (str_gsub): ditto.
* string.c (rb_str_ljust): ditto.
* string.c (rb_str_rjust): ditto.
* string.c (rb_str_center): ditto.
* eval.c (eval): retrieves file, line information from binding.
* eval.c (intersect_fds): counts intersecting fds.
* eval.c (rb_thread_schedule): only fds requested by
each thread count as select_value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
from local variable index. [new]
* eval.c (rb_eval): use rb_svar() for NODE_FLIP{2,3}.
* parse.y (rb_(backref|lastline)_(get|set)): access via rb_svar().
* eval.c (proc_invoke): push dynamic variables.
* eval.c (rb_thread_yield): push special variables as dynamic
variables($_, $~ and FLIP states).
* intern.h, parse.y (rb_is_local_id): return true if the ID is
local symbol. [new]
* parse.y (internal_id): make new ID for internal use. [new]
* parse.y (cond0): allocate internal ID for NODE_FLIP{2,3}.
* eval.c (rb_f_local_variables): use rb_is_local_id() to select
visible local variables.
* eval.c (rb_thread_start_0): SCOPE_SHARED is removed.
* eval.c, intern.h (rb_thread_scope_shared_p): removed. special
variables are no longer shared by threads.
* re.c (rb_reg_search): MATCHDATA is no longer shared by threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c (dir_path): new method.
* dir.c (dir_initialize): wrap DIR into struct, along with path
information.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1748 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
* 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
* 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
creating brand new exception object of the receiver.
* eval.c (rb_eval_string_wrap): extend new ruby_top_self, not
original self.
* eval.c (rb_eval_cmd): respect ruby_wrapper if set.
* eval.c (eval): do not update ruby_class unless scope is not
provided.
* eval.c (eval): preserve wrapper information.
* eval.c (proc_invoke): ditto.
* eval.c (block_pass): ditto.
* parse.y (void_expr): too much warnings for void context
(e.g. foo[1] that can be mere Proc call).
* error.c (rb_name_error): new function to raise NameError with
name attribute set.
* eval.c (rb_f_missing): set name and args in the exception
object. [new]
* error.c (name_name): NameError#name - new method.
* error.c (nometh_args): NoMethodError#args - new method.
* lex.c (rb_reserved_word): lex_state after tRESCUE should be
EXPR_MID.
* gc.c (add_heap): allocation size of the heap unit is doubled for
each allocation.
* dir.c (isdelim): space, tab, and newline are no longer
delimiters for glob patterns.
* eval.c (svalue_to_avalue): new conversion scheme between single
value and array values.
* eval.c (avalue_to_svalue): ditto.
* eval.c (rb_eval): REXPAND now uses avalue_to_svalue(), return
and yield too.
* eval.c (rb_yield_0): use avalue_to_svalue().
* eval.c (proc_invoke): Proc#call gives avaules, whereas
Proc#yield gives mvalues.
* eval.c (bmcall): convert given value (svalue) to avalue.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
stack bottom line.
* st.c (numhash): should shuffle bits by dividing by prime number.
* eval.c (rb_eval): multiple assignment behavior fixed, which
results "*a = nil" makes "a == []" now.
* eval.c (rb_f_require): should set SCOPE_PUBLIC before calling
dln_load().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
specified.
* regex.c (re_compile_pattern): too much optimization for the
cases like /(.|a)b/.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
and NoMethodError went under NameError.
* parse.y (rb_intern): non identifier symbols should be
categorized as ID_JUNK. [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1505 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
aliasing if $SAFE >= 4.
* parse.y (expr): "break" and "next" to take optional expression,
which is used as a value for termination. [new, experimental]
* eval.c (rb_eval): "break" can give value to terminating method.
* eval.c (rb_eval): "break" and "next" to take optional expression.
* eval.c (rb_yield_0): "next" can give value to terminating "yield".
* eval.c (rb_iterate): "break" can give value to terminating method.
* eval.c (proc_call): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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