1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-18 21:14:11 +01:00

21131: exit with status 127 when script not found

This commit is contained in:
Peter Stephenson 2005-04-11 10:23:55 +00:00
parent 030c8f6106
commit 7b9cff2754
3 changed files with 14 additions and 4 deletions

@ -1,3 +1,9 @@
2005-04-11 Peter Stephenson <pws@csr.com>
* 21131: Src/init.c, Test/A01grammar.ztst: exit with status 127
when a script is not found, making the error message more
sensible.
2005-04-10 Clint Adams <clint@zsh.org>
* unposted: config.guess, config.sub: update to 2005-03-24 and

@ -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)

@ -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