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

Re: typeset -F3 SECONDS doesn't work the first time



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