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

37435 (+ fix typo): allow execution of empty files as "sh" scripts

This commit is contained in:
Barton E. Schaefer 2015-12-25 00:31:32 -08:00
parent a554c7403a
commit fc344465f2
2 changed files with 5 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2015-12-25 Barton E. Schaefer <schaefer@zsh.org>
* 37435 (+ fix typo): Src/exec.c: allow execution of empty files
as "sh" scripts
* 37434: Src/exec.c: POSIXBUILTINS "command" should prevent shell
exit on errors from special builtins

View file

@ -471,9 +471,10 @@ zexecve(char *pth, char **argv, char **newenvp)
if ((fd = open(pth, O_RDONLY|O_NOCTTY)) >= 0) {
argv0 = *argv;
*argv = pth;
execvebuf[0] = '\0';
ct = read(fd, execvebuf, POUNDBANGLIMIT);
close(fd);
if (ct > 0) {
if (ct >= 0) {
if (execvebuf[0] == '#') {
if (execvebuf[1] == '!') {
for (t0 = 0; t0 != ct; t0++)