From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: time time
Date: Wed, 14 Jun 2000 11:25:27 +0200 (MET DST) [thread overview]
Message-ID: <200006140925.LAA19343@beta.informatik.hu-berlin.de> (raw)
[ sunsite sleeping again, great ]
Just found this on the Debian bug list...
Doing `time time' can be deadly. The problem is that it can't handle
time-in-a-time, but it still takes the second `time' as a special
token.
Dunno if this fix is correct, it makes the second `time' be taken as a
command name. At least it fixes the bug and trying to measure the
execution time of `time' without a command doesn't make sense
anyway. We could also make it report an error (bash does that, ksh
reports the times of `time' without arguments (hm) and the DU sh does
what zsh does with this patch -- measure execution times of the
external command `time').
Bye
Sven
Index: Src/parse.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/parse.c,v
retrieving revision 1.8
diff -u -r1.8 parse.c
--- Src/parse.c 2000/05/27 08:32:58 1.8
+++ Src/parse.c 2000/06/14 09:23:30
@@ -799,10 +799,6 @@
par_funcdef();
cmdpop();
break;
- case TIME:
- *complex = 1;
- par_time();
- break;
case DINBRACK:
cmdpush(CS_COND);
par_dinbrack();
@@ -813,6 +809,20 @@
ecstr(tokstr);
yylex();
break;
+ case TIME:
+ {
+ static int inpartime = 0;
+
+ if (!inpartime) {
+ *complex = 1;
+ inpartime = 1;
+ par_time();
+ inpartime = 0;
+ break;
+ }
+ }
+ tok = STRING;
+ /* fall through */
default:
{
int sr;
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
reply other threads:[~2000-06-14 9:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200006140925.LAA19343@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).