1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* io.c (argf_seek): wrong calling sequence of rb_io_seek().

* parse.y (stmt): while/until modifier must work for empty body.

* ruby.c (ruby_set_argv): clear ARGV contents before adding args.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-03-13 05:48:35 +00:00
parent 08aeee61b1
commit dfaeaa7f53
7 changed files with 28 additions and 24 deletions

View file

@ -1,3 +1,7 @@
Tue Mar 13 14:41:16 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (argf_seek): wrong calling sequence of rb_io_seek().
Mon Mar 12 18:59:38 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* lib/mkmf.rb (create_makefile): save/restore $libs and $LIBPATH.
@ -19,6 +23,14 @@ Wed Mar 7 14:26:11 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* math.c (math_log, math_log10): should return NaN if x < 0.0
on Cygwin.
Thu Mar 7 10:31:26 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* parse.y (stmt): while/until modifier must work for empty body.
Tue Mar 6 22:53:58 2001 Kazuhiro Yoshida <moriq.kazuhiro@nifty.ne.jp>
* ruby.c (ruby_set_argv): clear ARGV contents before adding args.
Tue Mar 6 10:50:29 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (primary): rescue and ensure clauses should be allowed

4
eval.c
View file

@ -4160,7 +4160,7 @@ stack_length(p)
#endif
if (p) *p = STACK_END;
#ifdef sparc
#ifdef __sparc__
return rb_gc_stack_start - STACK_END + 0x80;
#else
return (STACK_END < rb_gc_stack_start) ? rb_gc_stack_start - STACK_END
@ -6450,7 +6450,7 @@ block_pass(self, node)
break;
case TAG_BREAK:
if (orphan) {
rb_raise(rb_eLocalJumpError, "retry from proc-closure");
rb_raise(rb_eLocalJumpError, "break from proc-closure");
}
break;
case TAG_RETRY:

9
io.c
View file

@ -3095,8 +3095,9 @@ argf_tell()
}
static VALUE
argf_seek(self, offset, ptrname)
VALUE self, offset, ptrname;
argf_seek(argc, argv)
int argc;
VALUE *argv;
{
if (!next_argv()) {
rb_raise(rb_eArgError, "no stream to seek");
@ -3105,7 +3106,7 @@ argf_seek(self, offset, ptrname)
if (TYPE(current_file) != T_FILE) {
return argf_forward();
}
return rb_io_seek(current_file, offset, ptrname);
return rb_io_seek(argc, argv, current_file);
}
static VALUE
@ -3474,7 +3475,7 @@ Init_IO()
rb_define_singleton_method(argf, "getc", argf_getc, 0);
rb_define_singleton_method(argf, "readchar", argf_readchar, 0);
rb_define_singleton_method(argf, "tell", argf_tell, 0);
rb_define_singleton_method(argf, "seek", argf_seek, 2);
rb_define_singleton_method(argf, "seek", argf_seek, -1);
rb_define_singleton_method(argf, "rewind", argf_rewind, 0);
rb_define_singleton_method(argf, "pos", argf_tell, 0);
rb_define_singleton_method(argf, "pos=", argf_set_pos, 1);

View file

@ -8,7 +8,7 @@
# Usage:
# foo = Object.new
# foo2 = SimpleDelegator.new(foo)
# foo.hash == foo2.hash # => true
# foo.hash == foo2.hash # => false
#
# Foo = DelegateClass(Array)
#

View file

@ -375,7 +375,7 @@ def create_makefile(target, srcdir = File.dirname($0))
$DLDFLAGS = CONFIG["DLDFLAGS"]
$libs = CONFIG["LIBRUBYARG"] + " " + $libs
$configure_args['--enable-shared'] or $LIBPATH |= ["$(topdir)"]
$configure_args['--enable-shared'] or $LIBPATH |= [$topdir]
$LIBPATH |= [CONFIG["libdir"]]
defflag = ''

22
parse.y
View file

@ -360,31 +360,21 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
| stmt kWHILE_MOD expr
{
value_expr($3);
if ($1) {
if (nd_type($1) == NODE_BEGIN) {
$$ = NEW_WHILE(cond($3), $1->nd_body, 0);
}
else {
$$ = NEW_WHILE(cond($3), $1, 1);
}
if ($1 && nd_type($1) == NODE_BEGIN) {
$$ = NEW_WHILE(cond($3), $1->nd_body, 0);
}
else {
$$ = 0;
$$ = NEW_WHILE(cond($3), $1, 1);
}
}
| stmt kUNTIL_MOD expr
{
value_expr($3);
if ($1) {
if (nd_type($1) == NODE_BEGIN) {
$$ = NEW_UNTIL(cond($3), $1->nd_body, 0);
}
else {
$$ = NEW_UNTIL(cond($3), $1, 1);
}
if ($1 && nd_type($1) == NODE_BEGIN) {
$$ = NEW_UNTIL(cond($3), $1->nd_body, 0);
}
else {
$$ = 0;
$$ = NEW_UNTIL(cond($3), $1, 1);
}
}
| stmt kRESCUE_MOD stmt

1
ruby.c
View file

@ -989,6 +989,7 @@ ruby_set_argv(argc, argv)
if (origargv) dln_argv0 = origargv[0];
else dln_argv0 = argv[0];
#endif
rb_ary_clear(rb_argv);
for (i=0; i < argc; i++) {
rb_ary_push(rb_argv, rb_tainted_str_new2(argv[i]));
}