summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-18 00:19:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-18 00:19:10 +0000
commit233221db60c32a626b7e7d06dae71a4c3f78d380 (patch)
tree8b1b0e5114418465bc35aa55abb0893716199162 /ruby.c
parent73c8156360db536af7e64b062bda1bdd4454719d (diff)
* 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.c4
1 files changed, 2 insertions, 2 deletions
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);
}