Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: trapped in bash
- X-seq: zsh-users 22242
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Subject: Re: trapped in bash
- Date: Mon, 19 Dec 2016 17:47:46 +0000
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= mesmtp; bh=jgoXamsefObcBHYJHdfHFyXzeXA=; b=ytX0PocGhwN3YBQUjUmKg Hgd/HOESbuqDqPOYc+GyPnSpGa7VYYeGKOKPp5LFzBxgJqvXRjcCITns1oILffgE 6GuS2rGGg7oQX6txvYcbrOEQA3T8XCMj/WDkvdhmF5jEbrde/IHlsubMgJYUwD0R MzWebJphWSASS0mT6fhTFY=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=jgoXamsefObcBHYJHdfHFyXzeXA=; b=uq8bxWS3jzU7Y1jbnhMo tWDHZzNSEV/0suz6ugEgRX5/khd1qNclOSzFLly0kSLbW/XMmOHaRKMdsN6XH5eO p6zqVUsU0a5/7MlpDQJiOvsd0Iwp/5rvON44lEft7j8n6MiBFmW3n7QirtOYyAUE SlwZAJRA7Xkpokv5sOZqKJI=
- In-reply-to: <ab7aeb33-d091-6602-8baa-cce92300d289__26556.3400615521$1482166729$gmane$org@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <58559FC0.3080501@eastlink.ca> <161217124354.ZM7815@torch.brasslantern.com> <5855BEF2.6090208__18199.534857604$1482015164$gmane$org@eastlink.ca> <20161218150628.GB9158@fujitsu.shahaf.local2> <5856B133.9010602@eastlink.ca> <20161219003219.GA21509@fujitsu.shahaf.local2> <161218183056.ZM5304@torch.brasslantern.com> <9da2ae82-ac3f-6ee3-5452-5a008cf129e7@eastlink.ca> <161218214811.ZM5814@torch.brasslantern.com> <ab7aeb33-d091-6602-8baa-cce92300d289__26556.3400615521$1482166729$gmane$org@eastlink.ca>
Ray Andrews wrote on Mon, Dec 19, 2016 at 08:26:43 -0800:
> On 18/12/16 09:48 PM, Bart Schaefer wrote:
> >The shell finds the file, because it's responsible for path search.
> Exactly, I'd expect zsh to handle that with an appropriately helpful
> message, but past that point I quite understand that it's not the shell's
> affair. Mind, even subsequent error messages might be preceded by
> 'execve()' reports: ...' or something like that, it would just make further
> diagnosis a bit faster.
Yes, error messages should generally be signed.
Perhaps something along these lines? —
diff --git a/Src/exec.c b/Src/exec.c
index 7e29e9c..37d4690 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -699,7 +699,7 @@ execute(LinkList args, int flags, int defpath)
if (arg0 == s || unset(PATHDIRS) ||
(arg0[0] == '.' && (arg0 + 1 == s ||
(arg0[1] == '.' && arg0 + 2 == s)))) {
- zerr("%e: %s", lerrno, arg0);
+ zerr("execve: %e: %s", lerrno, arg0);
_exit((lerrno == EACCES || lerrno == ENOEXEC) ? 126 : 127);
}
break;
@@ -774,7 +774,7 @@ execute(LinkList args, int flags, int defpath)
}
if (eno)
- zerr("%e: %s", eno, arg0);
+ zerr("execve: %e: %s", eno, arg0);
else if (commandnotfound(arg0, args) == 0)
_exit(lastval);
else
diff --git a/Test/C05debug.ztst b/Test/C05debug.ztst
index 9a8df1d..ee2c1b8 100644
--- a/Test/C05debug.ztst
+++ b/Test/C05debug.ztst
@@ -52,15 +52,9 @@
# Failure
exit 10
HERE
- $ZTST_testdir/../Src/zsh -f ./zsh-trapreturn-bug2 2>erroutput.dif
- mystat=$?
- (
- setopt extendedglob
- print ${"$(< erroutput.dif)"%%:[^:]#: ./fdasfsdafd}
- )
- (( mystat == 0 ))
+ $ZTST_testdir/../Src/zsh -f ./zsh-trapreturn-bug2
0: trapreturn handling bug is properly fixed
->./zsh-trapreturn-bug2:5
+*?./zsh-trapreturn-bug2:5: execve:*./fdasfsdafd
fn() {
setopt localtraps localoptions debugbeforecmd
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index 45df9f5..d40dc2e 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -782,7 +782,7 @@
>File in upper dir
>File in lower dir
>unsetting option...
-?(eval):14: no such file or directory: pathtestdir/findme
+?(eval):14: execve: no such file or directory: pathtestdir/findme
(setopt pathdirs; path+=( /usr/bin ); type ./env)
1:whence honours PATH_DIRS option
Messages sorted by:
Reverse Date,
Date,
Thread,
Author