diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-18 00:19:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-18 00:19:10 +0000 |
commit | 233221db60c32a626b7e7d06dae71a4c3f78d380 (patch) | |
tree | 8b1b0e5114418465bc35aa55abb0893716199162 /ruby.c | |
parent | 73c8156360db536af7e64b062bda1bdd4454719d (diff) | |
download | ruby-233221db60c32a626b7e7d06dae71a4c3f78d380.tar.gz |
* 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 <mame AT tsg.ne.jp> at [ruby-dev:31243].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } |