Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: typeset -F3 SECONDS doesn't work the first time
- X-seq: zsh-workers 30536
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: typeset -F3 SECONDS doesn't work the first time
- Date: Wed, 27 Jun 2012 19:58:25 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HGA+frDaj23F9i2cPyMNVWOBUBOzvO1KsuTk/ohOEkE=; b=gmYH+eiec6A6zNrK1+lGM2NJnAIXhboQhv0FH7WYGrodOrF1s2xMO/KPKpABIKNBWZ HxgTp4Kfp7yWIcZ1D1iXkRdellso+QOCLtq0Z6Uc/S5T68l7iwjE0e94EpKQLnt5JHFX AsLPxipeUE/TTKwXC77BupJY1NsB7NCRpONGVriItZLuMm44xpxdvgekPWVW48HyFCO/ 4JshzFwyDSImA6bMxptID7eoULmKyyFmB9rX5ppS6FUBeFurjGcIm+mPIevG6WBiubt+ bLXCGh7pjjHBfk8I42kwnxib9EBF2EaDAna5y1cvhgV8RYjkXKeiyCblyYdexB5B1YRY K1Fw==
- In-reply-to: <120627105032.ZM25924@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHYJk3STsMvjebgpL5i_H1r2goNT4wV7AmhPPBdH1DGMAkZjEg@mail.gmail.com> <120627105032.ZM25924@torch.brasslantern.com>
On 27/06/2012, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jun 26, 6:26pm, Mikael Magnusson wrote:
> } Subject: typeset -F3 SECONDS doesn't work the first time
> }
> } I think the code in typeset_single() near
> } if (!readonly && !strcmp(pname, "SECONDS"))
> } is to blame, it does something magic if you're changing the type of
> } $SECONDS and then returns without checking any other options given to
> } typeset. I tried removing the return pm; and setting err=0; but that
> } segfaults.
>
> Try this:
>
> } else if (!setsecondstype(pm, on, off)) {
> if (value && !setsparam(pname, ztrdup(value)))
> return NULL;
> /* return pm; */
> usepm = 1;
> err = 0;
> }
>
> (Not provided as a patch because I don't have time right now to test it.)
This appears to work.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author