diff options
author | Paul Ackersviller <packersv@users.sourceforge.net> | 2007-05-03 04:28:50 +0000 |
---|---|---|
committer | Paul Ackersviller <packersv@users.sourceforge.net> | 2007-05-03 04:28:50 +0000 |
commit | 22fbfe532b864091c26336a6f60f5cb8b55b03c1 (patch) | |
tree | 35a7adcf25e09e7f8dd34884fbd82743f7c7f6ff | |
parent | 333ee0195a3d01067baae97d870015e199b91481 (diff) | |
download | zsh-22fbfe532b864091c26336a6f60f5cb8b55b03c1.tar.gz zsh-22fbfe532b864091c26336a6f60f5cb8b55b03c1.tar.xz zsh-22fbfe532b864091c26336a6f60f5cb8b55b03c1.zip |
Merge of workers/{21131,21328}.
-rw-r--r-- | Src/init.c | 10 | ||||
-rw-r--r-- | Test/A01grammar.ztst | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Src/init.c b/Src/init.c index 64c2fa041..cf892b09a 100644 --- a/Src/init.c +++ b/Src/init.c @@ -112,7 +112,7 @@ loop(int toplevel, int justonce) hbegin(1); /* init history mech */ if (isset(SHINSTDIN)) { setblock_stdin(); - if (interact) { + if (interact && toplevel) { int hstop = stophist; stophist = 3; preprompt(); @@ -308,14 +308,14 @@ parseargs(char **argv) } if (*argv) { if (unset(SHINSTDIN)) { - argzero = *argv; if (!cmd) - SHIN = movefd(open(unmeta(argzero), O_RDONLY | O_NOCTTY)); + SHIN = movefd(open(unmeta(*argv), O_RDONLY | O_NOCTTY)); if (SHIN == -1) { - zerr("can't open input file: %s", argzero, 0); - exit(1); + zerr("can't open input file: %s", *argv, 0); + exit(127); } opts[INTERACTIVE] &= 1; + argzero = *argv; argv++; } while (*argv) diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index 15df464e0..093ef5635 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -452,3 +452,7 @@ $ZTST_testdir/../Src/zsh -f -c "'" 1:Parse error on inline command causes non-zero exit status ?zsh: unmatched ' + + $ZTST_testdir/../Src/zsh -f NonExistentScript +127q:Non-existent script causes exit status 127 +?$ZTST_testdir/../Src/zsh: can't open input file: NonExistentScript |