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

Re: BUG: zsh-3.1.5-pws-24: time is dead



mason@xxxxxxxxxxxxxxx wrote:

> Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> typed:
> :mason@xxxxxxxxxxxxxxx wrote:
> :> % time =echo foobar
> :> foobar
> :This patch seems to work, but since I don't know why it worked before, 
> :I'm not really happy with it.
> 
> I'm not happy with it either.  It works, but it looks like a hack.
> Comment from zsh.h:
> 	#define STAT_NOPRINT    (1<<5)  /* job was killed internally,    */
> 	                                /*   we don't want to show that  */
> Is STAT_NOPRINT being used for other purposes now?  Are we getting the wrong
> status for jobs while trying to work around all these other programs which
> want certain pgrp/session requirements?

Yes. I knew about this, I only couldn't find the place where NOPRINT
was set where it hadn't been set before immediatly. But now I found it.

This goes on top of 6936, in the hope that this is more convenient for 
you.

Bye
 Sven

diff -u os/exec.c Src/exec.c
--- os/exec.c	Wed Jun 30 11:56:49 1999
+++ Src/exec.c	Fri Jul  2 08:30:18 1999
@@ -890,7 +890,7 @@
 
 	    lastwj = thisjob = newjob;
 
-	    if (list_pipe || pline_level)
+	    if (list_pipe || (pline_level && !(how & Z_TIMED)))
 		jn->stat |= STAT_NOPRINT;
 
 	    if (nowait) {
diff -u os/jobs.c Src/jobs.c
--- os/jobs.c	Thu Jul  1 08:50:47 1999
+++ Src/jobs.c	Fri Jul  2 08:28:42 1999
@@ -494,14 +494,9 @@
     int conted = 0, lineleng = columns, skip = 0, doputnl = 0;
     FILE *fout = (synch == 2) ? stdout : shout;
 
-    if (jn->stat & STAT_NOPRINT) {
-	if ((jn->stat & (STAT_TIMED | STAT_DONE)) == (STAT_TIMED | STAT_DONE) &&
-	    should_report_time(jn)) {
-	    jn->stat &= ~STAT_TIMED;
-	    dumptime(jn);
-	}
+    if (jn->stat & STAT_NOPRINT)
 	return;
-    }
+
     if (lng < 0) {
 	conted = 1;
 	lng = 0;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author