They are like instance and its class. [ruby-core:00941]
* parse.y (yylex): disallow global variables like "$1ve".
[ruby-core:00945]
* marshal.c (marshal_dump): Marshal.dump(0, false) should cause an
error. (ruby-bugs-ja PR#421)
* regex.c (re_compile_pattern): warn if '-' is the edge of
character range.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
size check. getnameinfo(3) can handle. [ruby-dev:19967]
* io.c (io_read): do not call rb_sys_fail() when required data
length is zero. (ruby-bugs-ja PR#420)
* eval.c (umethod_proc): should raise TypeError, instead of
returning error causing Proc. Following the principle of "fail
early". [ruby-core:00927]
* pack.c (pack_pack): small but serious typo.
* eval.c (backtrace): skip internal allocator frame.
(ruby-bugs-ja PR#416)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (env_delete_m): execute block only if deleting key does
not exist.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Clarify how "to_ary" and "to_a" work. [ruby-talk:68155]
* eval.c (svalue_to_avalue): ditto.
* eval.c (svalue_to_mrhs): ditto.
* eval.c (rb_eval): unary splat to use to_a, but we need a hack to
exclude Object#to_a until it's removed.
* object.c (rb_Array): check obj.respond_to?("to_a"). Currently
all object respond_to "to_a", but Object#to_a will be removed.
* range.c (Init_Range): undefine to_ary.
* re.c (Init_Regexp): ditto.
* regex.c (re_compile_pattern): do not warn if "-" is at the top
or last of character class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
instance variable to get rid of GC. [ruby-dev:19932]
* variable.c (classname): remove temporary class path when exact
name found.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
/[\[:digit:]]/ was treated as /[[:digit:]]/.
/[[:-@]/ was treated as /[\[:\-@]/.
/[%-[:digit:]]/ was treated as /[%-\[:digit:]\]/.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c (dir_s_getwd): should check rb_secure(4).
* object.c (rb_obj_infect): function version of OBJ_INFECT().
* eval.c (rb_secure_update): new function to check object update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/strscan/strscan.c: use snprintf() instead of sprintf().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (read_all): make str empty if given. (ruby-bugs-ja PR#408)
* io.c (io_read): ditto.
* io.c (rb_io_sysread): ditto.
* range.c: do not override min and max.
* sprintf.c (remove_sign_bits): octal left most digit for negative
numbers may be '3'. (ruby-bugs-ja PR#407)
* sprintf.c (rb_f_sprintf): should prefix sign bits if bignum is
negative, using sign_bits().
* eval.c (avalue_to_mrhs): split argument passing and assignment
conversion.
* eval.c (svalue_to_mrhs): ditto.
* eval.c (avalue_to_svalue): avalue_to_svalue([[1,2]]) should be
[[1,2]], not [1,2] to wrap-around.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/pop.rb: merge the 'STAT' patch from Frank S.Fejes <frank@oopdreams.com>, with modifications (listed below).
* lib/net/pop.rb: new method Net::POP#mail_size.
* lib/net/pop.rb: new method Net::POP#bytes.
* lib/net/pop.rb: new method Net::POPCommand#stat.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Makefile.in (fake.rb): set ALT_SEPARATOR to the default value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (proc_detach): new method Proc#detach(pid) which
create background watcher thread to issue waitpid. [new]
* process.c (rb_detach_process): utility function to detach
process from C code.
* ext/pty/pty.c (pty_finalize_syswait): terminate watcher thread,
and detach child process (by creating new idle waitpid watcher
thread).
* ext/pty/pty.c (pty_syswait): may lost signal stopped child.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3561 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
"close" method instead. [ruby-dev:19717]
* io.c (rb_io_s_open): ditto.
* hash.c (rb_any_hash): remove DEFER_INTS. all do_hash() calls in
st.c are at the top of functions. No reentrant problem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* marshal.c (dump_ensure): ditto.
* marshal.c (marshal_dump): should call "binmode" method, if it
responds to.
* marshal.c (r_byte): should input always via "getc" method.
* marshal.c (r_bytes0): should input always via "read" method.
* marshal.c (marshal_load): need not to set up FILE* fp;
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_fread): should not clearerr() if there's no filled
buffer (i.e. rb_io_fread() returning zero).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_gc_stack_start.
* gc.c (Init_stack): update rb_gc_stack_start if it is lower (or
higher if stack grows down) than the previous value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_thread_die(). this change was suggested by Rudi Cilibrasi
<cilibrar@drachma.ugcs.caltech.edu>.
* eval.c (rb_thread_start_0): main thread swapped by fork() may
terminate rb_thread_start_0() successfully. call ruby_stop(0);
this change too was suggested by Rudi.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (primary): "self[n]=x" can be legal even when "[]=" is
private. changes submitted in [ruby-talk:63982]
* parse.y (aryset): ditto.
* parse.y (attrset): "self.foo=x" can be legal even when "foo="
is private.
* eval.c (is_defined): private "[]=" and "foo=" support.
* eval.c (rb_eval): ditto.
* eval.c (assign): ditto.
* eval.c (rb_eval): "foo=" should not always be public.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
attribute reader method.
* variable.c (rb_attr_get): new function to get instance variable
without uninitialized warning.
* io.c (argf_to_io): should prefetch argv.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
expanding default directory.
* file.c (file_expand_path): default directory was being
ignored if path was full path with no drive letter, under
DOSISH.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
returns arguments passed by caller.
* lib/uri/generic.rb (Generic#to_str, Generic#to_s): removed to_str.
Suggested by Tanaka Akira <akr@m17n.org> at [ruby-dev:19475].
* lib/uri/generic.rb (Generic#==): should not generate an URI object
from argument. Suggested by Tanaka Akira <akr@m17n.org> at
[ruby-dev:19475].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (rb_thread_schedule): pause if no runnable thread when
there's only one thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
before use strncpy().
* ruby.c (proc_options): avoid SEGV at -S with no arguments.
(ruby-bugs-ja:PR#391)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3489 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
* lib/fileutils.rb: FileUtils.pwd, cmp, identical?, uptodate? does not accept any option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
error.
* misc/ruby-mode.el (ruby-font-lock-keywords): method name can
be delimited by tab.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
it easier to write extensions that work with both ~1.6 and 1.8~.
* intern.h (RB_CVAR_SET_4ARGS): Ditto.
* ruby.h (NORETURN_STYLE_NEW): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3458 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
if the next argument doesn't start with '-', use it as the
value.
* lib/optparse.rb (OptionParser::make_switch): fixed a bug of
pattern.
* lib/optparse.rb (Array): no need to guard.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
hyphen to the first argument of MAKEFLAGS only if appropriate.
Remove wrong comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
there is no such a variable.
* instruby.rb ($mflags.set?), ext/extmk.rb ($mflags.set?): Return
false if unmatched.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
and emulate a dry run. Use 'make' in case no --make argument is
given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
including FileUtils::Verbose, in order to suppress messages from
FileUtils#cmp.
* lib/fileutils.rb (FileUtils::Verbose, FileUtils::NoWrite):
re-define methods with define_method instead of module_eval.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
bcc32/Makefile.sub: Replace the complicated MFLAGS/MAKEFLAGS
parser with something plain and comprehensible. This fixes a
bug where make flags were wrongly reordered and the resulted
command line often did not make sense especially when BSD make
is used with extra arguments given. Tested with FreeBSD and
Linux by me and mswin32, bccwin32 and mingw by usa.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
with escaped $ and ? at the end of strings. [ruby-talk:62297]
* misc/ruby-mode.el (ruby-font-lock-keywords): added defined?.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (num_quo): should return most exact quotient value,
i.e. float by default, rational if available.
* numeric.c (num_div): "div" should return x.divmod(x)[0].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (negate_lit): new function to negate literal numeric
values in compile time.
* regex.c (re_match_exec): charset info may be stored in MBC
region when $KCODE != NONE.
* error.c (set_syserr): should preserve duplicated error names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
mdoc. Provide a new option --with-mantype={doc|man} in case the
check does not work as expected.
* Makefile.in (MANTYPE): Define MANTYPE and pass it to
instruby.rb.
* instruby.rb: Convert mdoc manpages to man for systems which
nroff(1) does not grok mdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
tempfile as an argument and automatically close the tempfile
when the block terminates.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (dir_config): prior configured directories to
defaults.
* lib/mkmf.rb (dir_config): extract first word to determin
make command type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
quotes should not be regarded as meta character. This bug or
maybe feature was inherited from Perl's shellwords.pl.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
variable v, that a bignum unexpectedly gets converted into a
string with its higher figures all filled with ./f/7/1,
depending on the base. This bug seems to have been introduced
in rev.1.27.
* sprintf.c (rb_f_sprintf): Use switch instead of a sequence of
else-if's.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
AIX. [ruby-talk:61466]
* marshal.c (math.h): should be included after ruby.h on AIX.
[ruby-talk:61366]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
classes are not allowed inside character classes.
[ruby-talk:60996]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
fflush() are needed.
* io.c (flush_before_seek): flush write stream only.
* io.c (rb_io_check_readable): seek instead of flush if the last
operation was write.
* io.c (rb_io_check_writable): seek instead of flush if the last
operation was read.
* bcc32/Makefile.sub, win32/Makefile.sub: needs to seek between
R/W.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
unnecessary
* intern.h: debug does not run if ID_ALLOCATOR is zero.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3310 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
I was wrong about something. It was a return value,
not arguments that are not covered by the int-to-long promotion rule
on IA64, if the function is not explicitly declared.
The commit itself was generally a right thing to do, but just let me
correct my commit message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
st_compare_func_t, st_hash_func_t and st_each_func_t.
* st.h, st.c: Do explicit function declarations and do not rely on
implicit declarations. On such platforms as IA64, int argument
values are NOT automatically promoted to long (64bit) values, so
explicit declarations are mandatory for those functions that
take long values or pointers. This fixes miniruby's coredump on
FreeBSD/IA64.
* class.c, eval.c, gc.c, hash.c, marshal.c, parse.y, variable.c:
Add proper casts to avoid warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/digest/md5/md5ossl.c: Include stdio.h for sprintf() and
string.h for memcmp().
* ext/dl/ptr.c: Include ctype.h for isdigit().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/extmk.rb (sysquote): do not need to quote on mswin/bccwin/mingw.
* ext/extm.rb ($mflags): uniq items and remove '-' and '--'.
move options to the lead.
* lib/fileutils.rb (install): model on the real install
command(message).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
inline function instead so it can be used as an expression.
* eval.c (EXEC_TAG, THREAD_SAVE_CONTEXT): Consistently call
FLUSH_REGISTER_WINDOWS before calling setjmp(). (I suspect that
every setjmp() implementation should take care of register
windows, though)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3285 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@3269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
NEW_CFUNC() sets argc to a wrong value on platforms where
sizeof(int) != sizeof(long) and the byte order is big-endian.
This fixes breakage on FreeBSD/sparc64.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
NI_MAXHOST only if they are not defined yet. This fixes build
such platforms as OpenBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
lib{tcl,tk}M.N and lib{tcl,tk}MN on all platforms. *BSD have
Tcl/Tk libraries named this way.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3253 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
the first word of --make-flags is always options even unless
preceeded by -, and ignore letter-case of options if nmake.
* instruby.rb: extract -n option also from --make and
--make-flags.
* bcc32/Makefile.sub, win32/Makefile.sub: not prepend - to
$(MFLAGS)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
present, instead of the original string. (ruby-bugs:PR#528)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
init_inetsock() is VALUE but not pointer.
* ext/socket/socket.c (sock_s_unpack_sockaddr_in): get rid of
gcc-3 -O3 warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e