Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh exec format error with empty files
- X-seq: zsh-workers 37435
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: zsh exec format error with empty files
- Date: Fri, 25 Dec 2015 00:27:25 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=rQNqZxeMrGJYX7FMw0V3yFqFyG2F5guOEzj+SeQ2M8Y=; b=afcTmXg85xpAk/ObQEzNWFOoXzoGjCXV/EiQXlleEU1zTGu4BjRQmbeeXr4HbLzcw+ Wdb0Ht2FRxSlMyXLGOZ+xkNhD8hkEzFuzwJ90HS/adtkP4xyISoSixeGcaw40lYkIhfk YL9nBl+PjeA8IWdzz1HI8UnpBC7AkHZX8J7MSSA0hwCa/kRNLkdcFSOwPZi+n0/rRsnx 50SQGtwryS69bTRZ94nRtgeNQ6Fbu7HPn1knRzk9W03EC3++XdPIviT8u8mondOtrGwp 9SM1SKBIRMsgcIrgVUDqYaGM1JT4n3l4aiVpwCfL2MBgzIc15mkYaWrXEKZf8abbSJ+r bQBA==
- In-reply-to: <871tad6qux.fsf@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <871tad6qux.fsf@gmail.com>
On Dec 23, 6:01pm, Christian Neukirchen wrote:
}
} % ./empty
} zsh: exec format error: ./empty
}
} For consistency, this should just run /bin/sh as well and return 0,
} like in bash, dash, busybox sh, tcsh, mksh, ksh93, posh, Byron's rc
} and every tool using execvp.
Hm.
diff --git a/Src/exec.c b/Src/exec.c
index acc867c..c4dc8e3 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;
+ execvbuf[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++)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author