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:
parent
08aeee61b1
commit
dfaeaa7f53
7 changed files with 28 additions and 24 deletions
12
ChangeLog
12
ChangeLog
|
@ -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>
|
Mon Mar 12 18:59:38 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* lib/mkmf.rb (create_makefile): save/restore $libs and $LIBPATH.
|
* 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
|
* math.c (math_log, math_log10): should return NaN if x < 0.0
|
||||||
on Cygwin.
|
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>
|
Tue Mar 6 10:50:29 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (primary): rescue and ensure clauses should be allowed
|
* parse.y (primary): rescue and ensure clauses should be allowed
|
||||||
|
|
4
eval.c
4
eval.c
|
@ -4160,7 +4160,7 @@ stack_length(p)
|
||||||
#endif
|
#endif
|
||||||
if (p) *p = STACK_END;
|
if (p) *p = STACK_END;
|
||||||
|
|
||||||
#ifdef sparc
|
#ifdef __sparc__
|
||||||
return rb_gc_stack_start - STACK_END + 0x80;
|
return rb_gc_stack_start - STACK_END + 0x80;
|
||||||
#else
|
#else
|
||||||
return (STACK_END < rb_gc_stack_start) ? rb_gc_stack_start - STACK_END
|
return (STACK_END < rb_gc_stack_start) ? rb_gc_stack_start - STACK_END
|
||||||
|
@ -6450,7 +6450,7 @@ block_pass(self, node)
|
||||||
break;
|
break;
|
||||||
case TAG_BREAK:
|
case TAG_BREAK:
|
||||||
if (orphan) {
|
if (orphan) {
|
||||||
rb_raise(rb_eLocalJumpError, "retry from proc-closure");
|
rb_raise(rb_eLocalJumpError, "break from proc-closure");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TAG_RETRY:
|
case TAG_RETRY:
|
||||||
|
|
9
io.c
9
io.c
|
@ -3095,8 +3095,9 @@ argf_tell()
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
argf_seek(self, offset, ptrname)
|
argf_seek(argc, argv)
|
||||||
VALUE self, offset, ptrname;
|
int argc;
|
||||||
|
VALUE *argv;
|
||||||
{
|
{
|
||||||
if (!next_argv()) {
|
if (!next_argv()) {
|
||||||
rb_raise(rb_eArgError, "no stream to seek");
|
rb_raise(rb_eArgError, "no stream to seek");
|
||||||
|
@ -3105,7 +3106,7 @@ argf_seek(self, offset, ptrname)
|
||||||
if (TYPE(current_file) != T_FILE) {
|
if (TYPE(current_file) != T_FILE) {
|
||||||
return argf_forward();
|
return argf_forward();
|
||||||
}
|
}
|
||||||
return rb_io_seek(current_file, offset, ptrname);
|
return rb_io_seek(argc, argv, current_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -3474,7 +3475,7 @@ Init_IO()
|
||||||
rb_define_singleton_method(argf, "getc", argf_getc, 0);
|
rb_define_singleton_method(argf, "getc", argf_getc, 0);
|
||||||
rb_define_singleton_method(argf, "readchar", argf_readchar, 0);
|
rb_define_singleton_method(argf, "readchar", argf_readchar, 0);
|
||||||
rb_define_singleton_method(argf, "tell", argf_tell, 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, "rewind", argf_rewind, 0);
|
||||||
rb_define_singleton_method(argf, "pos", argf_tell, 0);
|
rb_define_singleton_method(argf, "pos", argf_tell, 0);
|
||||||
rb_define_singleton_method(argf, "pos=", argf_set_pos, 1);
|
rb_define_singleton_method(argf, "pos=", argf_set_pos, 1);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# Usage:
|
# Usage:
|
||||||
# foo = Object.new
|
# foo = Object.new
|
||||||
# foo2 = SimpleDelegator.new(foo)
|
# foo2 = SimpleDelegator.new(foo)
|
||||||
# foo.hash == foo2.hash # => true
|
# foo.hash == foo2.hash # => false
|
||||||
#
|
#
|
||||||
# Foo = DelegateClass(Array)
|
# Foo = DelegateClass(Array)
|
||||||
#
|
#
|
||||||
|
|
|
@ -375,7 +375,7 @@ def create_makefile(target, srcdir = File.dirname($0))
|
||||||
$DLDFLAGS = CONFIG["DLDFLAGS"]
|
$DLDFLAGS = CONFIG["DLDFLAGS"]
|
||||||
|
|
||||||
$libs = CONFIG["LIBRUBYARG"] + " " + $libs
|
$libs = CONFIG["LIBRUBYARG"] + " " + $libs
|
||||||
$configure_args['--enable-shared'] or $LIBPATH |= ["$(topdir)"]
|
$configure_args['--enable-shared'] or $LIBPATH |= [$topdir]
|
||||||
$LIBPATH |= [CONFIG["libdir"]]
|
$LIBPATH |= [CONFIG["libdir"]]
|
||||||
|
|
||||||
defflag = ''
|
defflag = ''
|
||||||
|
|
14
parse.y
14
parse.y
|
@ -360,33 +360,23 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
|
||||||
| stmt kWHILE_MOD expr
|
| stmt kWHILE_MOD expr
|
||||||
{
|
{
|
||||||
value_expr($3);
|
value_expr($3);
|
||||||
if ($1) {
|
if ($1 && nd_type($1) == NODE_BEGIN) {
|
||||||
if (nd_type($1) == NODE_BEGIN) {
|
|
||||||
$$ = NEW_WHILE(cond($3), $1->nd_body, 0);
|
$$ = NEW_WHILE(cond($3), $1->nd_body, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$$ = NEW_WHILE(cond($3), $1, 1);
|
$$ = NEW_WHILE(cond($3), $1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$$ = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
| stmt kUNTIL_MOD expr
|
| stmt kUNTIL_MOD expr
|
||||||
{
|
{
|
||||||
value_expr($3);
|
value_expr($3);
|
||||||
if ($1) {
|
if ($1 && nd_type($1) == NODE_BEGIN) {
|
||||||
if (nd_type($1) == NODE_BEGIN) {
|
|
||||||
$$ = NEW_UNTIL(cond($3), $1->nd_body, 0);
|
$$ = NEW_UNTIL(cond($3), $1->nd_body, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$$ = NEW_UNTIL(cond($3), $1, 1);
|
$$ = NEW_UNTIL(cond($3), $1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$$ = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
| stmt kRESCUE_MOD stmt
|
| stmt kRESCUE_MOD stmt
|
||||||
{
|
{
|
||||||
$$ = NEW_RESCUE($1, NEW_RESBODY(0,$3,0), 0);
|
$$ = NEW_RESCUE($1, NEW_RESBODY(0,$3,0), 0);
|
||||||
|
|
1
ruby.c
1
ruby.c
|
@ -989,6 +989,7 @@ ruby_set_argv(argc, argv)
|
||||||
if (origargv) dln_argv0 = origargv[0];
|
if (origargv) dln_argv0 = origargv[0];
|
||||||
else dln_argv0 = argv[0];
|
else dln_argv0 = argv[0];
|
||||||
#endif
|
#endif
|
||||||
|
rb_ary_clear(rb_argv);
|
||||||
for (i=0; i < argc; i++) {
|
for (i=0; i < argc; i++) {
|
||||||
rb_ary_push(rb_argv, rb_tainted_str_new2(argv[i]));
|
rb_ary_push(rb_argv, rb_tainted_str_new2(argv[i]));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue