Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: trapped in bash



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