From 233221db60c32a626b7e7d06dae71a4c3f78d380 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 18 Jul 2007 00:19:10 +0000 Subject: * parse.y (rb_parser_append_print, rb_parser_while_loop): moved check for node to the head. * ruby.c (proc_options): do nothing for -p/-n options if tree is null. submitted by Yusuke ENDOH at [ruby-dev:31243]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index aae62f27e0..89aeae9857 100644 --- a/ruby.c +++ b/ruby.c @@ -883,10 +883,10 @@ proc_options(int argc, char **argv) FL_UNSET(rb_load_path, FL_TAINT); } - if (do_print) { + if (tree && do_print) { tree = rb_parser_append_print(parser, tree); } - if (do_loop) { + if (tree && do_loop) { tree = rb_parser_while_loop(parser, tree, do_line, do_split); } -- cgit v1.2.3