about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c3
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++)