* Re: BUG: zsh-3.1.5-pws-24: time is dead
@ 1999-07-01 6:39 Sven Wischnowsky
1999-07-02 2:05 ` Geoff Wing
0 siblings, 1 reply; 5+ messages in thread
From: Sven Wischnowsky @ 1999-07-01 6:39 UTC (permalink / raw)
To: zsh-workers
mason@primenet.com.au wrote:
> Heyla,
> % zsh -f
> % time =echo foobar
> foobar
> % =time =echo foobar
> foobar
> 0.01 real 0.00 user 0.01 sys
> % which -a time
> time: shell reserved word
> /usr/bin/time
> %
It may well be that it was me who broke this.
This patch seems to work, but since I don't know why it worked before,
I'm not really happy with it.
Bye
Sven
diff -u os/jobs.c Src/jobs.c
--- os/jobs.c Wed Jun 30 11:56:49 1999
+++ Src/jobs.c Thu Jul 1 08:31:58 1999
@@ -494,9 +494,14 @@
int conted = 0, lineleng = columns, skip = 0, doputnl = 0;
FILE *fout = (synch == 2) ? stdout : shout;
- if (jn->stat & STAT_NOPRINT)
+ 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);
+ }
return;
-
+ }
if (lng < 0) {
conted = 1;
lng = 0;
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BUG: zsh-3.1.5-pws-24: time is dead
1999-07-01 6:39 BUG: zsh-3.1.5-pws-24: time is dead Sven Wischnowsky
@ 1999-07-02 2:05 ` Geoff Wing
0 siblings, 0 replies; 5+ messages in thread
From: Geoff Wing @ 1999-07-02 2:05 UTC (permalink / raw)
To: zsh-workers
Sven Wischnowsky <wischnow@informatik.hu-berlin.de> typed:
:mason@primenet.com.au 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?
PS. breakage occured between pws-22 and pws-23
Regards,
--
Geoff Wing : <gcw@pobox.com> Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@rxvt.org> Ego URL : http://pobox.com/~gcw/
Zsh Stuff : <gcw@zsh.org> Phone : (Australia) 0413 431 874
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BUG: zsh-3.1.5-pws-24: time is dead
@ 1999-07-02 6:32 Sven Wischnowsky
1999-07-02 8:07 ` Geoff Wing
0 siblings, 1 reply; 5+ messages in thread
From: Sven Wischnowsky @ 1999-07-02 6:32 UTC (permalink / raw)
To: zsh-workers
mason@primenet.com.au wrote:
> Sven Wischnowsky <wischnow@informatik.hu-berlin.de> typed:
> :mason@primenet.com.au 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@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* BUG: zsh-3.1.5-pws-24: time is dead
@ 1999-06-30 18:09 Geoff Wing
0 siblings, 0 replies; 5+ messages in thread
From: Geoff Wing @ 1999-06-30 18:09 UTC (permalink / raw)
To: zsh-workers
Heyla,
% zsh -f
% time =echo foobar
foobar
% =time =echo foobar
foobar
0.01 real 0.00 user 0.01 sys
% which -a time
time: shell reserved word
/usr/bin/time
%
--
Geoff Wing : <gcw@pobox.com> Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@rxvt.org> Ego URL : http://pobox.com/~gcw/
Zsh Stuff : <gcw@zsh.org> Phone : (Australia) 0413 431 874
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1999-07-02 8:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-01 6:39 BUG: zsh-3.1.5-pws-24: time is dead Sven Wischnowsky
1999-07-02 2:05 ` Geoff Wing
-- strict thread matches above, loose matches on Subject: below --
1999-07-02 6:32 Sven Wischnowsky
1999-07-02 8:07 ` Geoff Wing
1999-06-30 18:09 Geoff Wing
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).