mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-07 11:41:16 +02:00
23008: failure to output error message could alter exit status
This commit is contained in:
parent
7c98ca21f5
commit
6d0dc9e0eb
2 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2006-11-19 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
|
* 23008: Src/exec.c: failure to output error message could
|
||||||
|
alter exit status.
|
||||||
|
|
||||||
2006-11-18 Clint Adams <clint@zsh.org>
|
2006-11-18 Clint Adams <clint@zsh.org>
|
||||||
|
|
||||||
* 23005: Completion/Unix/Command/_toilet: completion
|
* 23005: Completion/Unix/Command/_toilet: completion
|
||||||
|
|
|
@ -522,12 +522,12 @@ execute(LinkList args, int dash, int defpath)
|
||||||
}
|
}
|
||||||
for (s = arg0; *s; s++)
|
for (s = arg0; *s; s++)
|
||||||
if (*s == '/') {
|
if (*s == '/') {
|
||||||
errno = zexecve(arg0, argv);
|
int lerrno = zexecve(arg0, argv);
|
||||||
if (arg0 == s || unset(PATHDIRS) ||
|
if (arg0 == s || unset(PATHDIRS) ||
|
||||||
(arg0[0] == '.' && (arg0 + 1 == s ||
|
(arg0[0] == '.' && (arg0 + 1 == s ||
|
||||||
(arg0[1] == '.' && arg0 + 2 == s)))) {
|
(arg0[1] == '.' && arg0 + 2 == s)))) {
|
||||||
zerr("%e: %s", errno, arg0);
|
zerr("%e: %s", lerrno, arg0);
|
||||||
_exit((errno == EACCES || errno == ENOEXEC) ? 126 : 127);
|
_exit((lerrno == EACCES || lerrno == ENOEXEC) ? 126 : 127);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue