From 050f2d84603bd9b3761f1e498f81ce74719caeea Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 13 Feb 2003 03:02:19 +0000 Subject: * ruby.c (proc_options): script argument is in effect only when -e is not given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index bc24ef2536..40d9dbd23f 100644 --- a/ruby.c +++ b/ruby.c @@ -705,19 +705,17 @@ proc_options(argc, argv) OBJ_TAINT(rb_load_path); } - if (argc == 0) { /* no more args */ - if (!e_script) { + if (!e_script) { + if (argc == 0) { /* no more args */ if (verbose) exit(0); script = "-"; } - } - else if (!e_script) { - script = argv[0]; - if (script[0] == '\0') { - script = "-"; - } else { - if (do_search) { + script = argv[0]; + if (script[0] == '\0') { + script = "-"; + } + else if (do_search) { char *path = getenv("RUBYPATH"); script = 0; @@ -732,8 +730,8 @@ proc_options(argc, argv) #ifdef DOSISH translate_char(script, '\\', '/'); #endif + argc--; argv++; } - argc--; argv++; } ruby_script(script); -- cgit v1.2.3