1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 10:21:46 +02:00

Merge of workers/{21131,21328}.

This commit is contained in:
Paul Ackersviller 2007-05-03 04:28:50 +00:00
parent 333ee0195a
commit 22fbfe532b
2 changed files with 9 additions and 5 deletions

View file

@ -112,7 +112,7 @@ loop(int toplevel, int justonce)
hbegin(1); /* init history mech */ hbegin(1); /* init history mech */
if (isset(SHINSTDIN)) { if (isset(SHINSTDIN)) {
setblock_stdin(); setblock_stdin();
if (interact) { if (interact && toplevel) {
int hstop = stophist; int hstop = stophist;
stophist = 3; stophist = 3;
preprompt(); preprompt();
@ -308,14 +308,14 @@ parseargs(char **argv)
} }
if (*argv) { if (*argv) {
if (unset(SHINSTDIN)) { if (unset(SHINSTDIN)) {
argzero = *argv;
if (!cmd) if (!cmd)
SHIN = movefd(open(unmeta(argzero), O_RDONLY | O_NOCTTY)); SHIN = movefd(open(unmeta(*argv), O_RDONLY | O_NOCTTY));
if (SHIN == -1) { if (SHIN == -1) {
zerr("can't open input file: %s", argzero, 0); zerr("can't open input file: %s", *argv, 0);
exit(1); exit(127);
} }
opts[INTERACTIVE] &= 1; opts[INTERACTIVE] &= 1;
argzero = *argv;
argv++; argv++;
} }
while (*argv) while (*argv)

View file

@ -452,3 +452,7 @@
$ZTST_testdir/../Src/zsh -f -c "'" $ZTST_testdir/../Src/zsh -f -c "'"
1:Parse error on inline command causes non-zero exit status 1:Parse error on inline command causes non-zero exit status
?zsh: unmatched ' ?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