summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-13 03:02:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-13 03:02:19 +0000
commit4eff72b9891159bfb58d82d26869adfeaa37f6a5 (patch)
tree714f8ff4c1f54aa55502e9acc1a2c874569a4c2a
parentd2698c2a59ceb3513208b8096ad9795c09822558 (diff)
downloadruby-4eff72b9891159bfb58d82d26869adfeaa37f6a5.tar.gz
ruby-4eff72b9891159bfb58d82d26869adfeaa37f6a5.tar.xz
ruby-4eff72b9891159bfb58d82d26869adfeaa37f6a5.zip
* ruby.c (proc_options): script argument is in effect only when -e is not given.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog3
-rw-r--r--ruby.c18
2 files changed, 10 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index fa52ef190..bf185500a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,10 @@
-Thu Feb 13 09:58:12 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+Thu Feb 13 11:54:50 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* ruby.c (ruby_init_loadpath): ensures buffer terminated
before use strncpy().
* ruby.c (proc_options): avoid SEGV at -S with no arguments.
+ script argument is in effect only when -e is not given.
(ruby-bugs-ja:PR#391)
Thu Feb 13 01:30:10 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
diff --git a/ruby.c b/ruby.c
index bc24ef253..40d9dbd23 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);