diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-26 18:43:07 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-26 18:43:07 +0000 |
commit | 1dc6ee079b70b77342d2b9180e5d19f55cc6ba0c (patch) | |
tree | 32207d6b34619a74279d76c17751b46290e6dff1 /Src/init.c | |
parent | 4d86ee0d400f5a3283eacf2307be499bc1392550 (diff) | |
download | zsh-1dc6ee079b70b77342d2b9180e5d19f55cc6ba0c.tar.gz zsh-1dc6ee079b70b77342d2b9180e5d19f55cc6ba0c.tar.xz zsh-1dc6ee079b70b77342d2b9180e5d19f55cc6ba0c.zip |
zsh-workers/7510
Diffstat (limited to 'Src/init.c')
-rw-r--r-- | Src/init.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Src/init.c b/Src/init.c index 136c718d0..2761a6afc 100644 --- a/Src/init.c +++ b/Src/init.c @@ -213,14 +213,9 @@ parseargs(char **argv) } if (**argv == 'c') { /* -c command */ - if (!*++argv) { - zerr("string expected after -c", NULL, 0); - exit(1); - } - cmd = *argv++; + cmd = *argv; opts[INTERACTIVE] &= 1; opts[SHINSTDIN] = 0; - goto doneoptions; } else if (**argv == 'o') { if (!*++*argv) argv++; @@ -257,6 +252,13 @@ parseargs(char **argv) } doneoptions: paramlist = newlinklist(); + if (cmd) { + if (!*argv) { + zerr("string expected after -%s", cmd, 0); + exit(1); + } + cmd = *argv++; + } if (*argv) { if (unset(SHINSTDIN)) { argzero = *argv; |