zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: typeset -F3 SECONDS doesn't work the first time
Date: Wed, 27 Jun 2012 19:58:25 +0200	[thread overview]
Message-ID: <CAHYJk3TR6G2WPy_u3n=64yYXuW9XsH1UPqPwqKCQSHpYXRD5Fg@mail.gmail.com> (raw)
In-Reply-To: <120627105032.ZM25924@torch.brasslantern.com>

On 27/06/2012, Bart Schaefer <schaefer@brasslantern.com> 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


  reply	other threads:[~2012-06-27 17:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 16:26 Mikael Magnusson
2012-06-27 17:50 ` Bart Schaefer
2012-06-27 17:58   ` Mikael Magnusson [this message]
2012-06-28 16:54     ` Bart Schaefer
2012-06-28 17:04       ` Mikael Magnusson
2012-06-28 18:06         ` Bart Schaefer
2012-06-28 18:11           ` Mikael Magnusson
2012-06-28 22:00             ` Bart Schaefer

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='CAHYJk3TR6G2WPy_u3n=64yYXuW9XsH1UPqPwqKCQSHpYXRD5Fg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).