diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2015-12-25 00:31:32 -0800 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2015-12-25 00:31:32 -0800 |
commit | fc344465f27cdf89664a64fb157b7606c9eb837f (patch) | |
tree | d67c21e5203c5aeffbd27e8736cf78a2c8aa24da /Src/exec.c | |
parent | a554c7403a0f1b6c29e07410a03599272aeaeaee (diff) | |
download | zsh-fc344465f27cdf89664a64fb157b7606c9eb837f.tar.gz zsh-fc344465f27cdf89664a64fb157b7606c9eb837f.tar.xz zsh-fc344465f27cdf89664a64fb157b7606c9eb837f.zip |
37435 (+ fix typo): allow execution of empty files as "sh" scripts
Diffstat (limited to 'Src/exec.c')
-rw-r--r-- | Src/exec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c index f14fc27a6..18d19b672 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -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++) |