From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22489 invoked by alias); 27 Jun 2012 17:59:10 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30536 Received: (qmail 16905 invoked from network); 27 Jun 2012 17:58:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.160.43 as permitted sender) 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== MIME-Version: 1.0 In-Reply-To: <120627105032.ZM25924@torch.brasslantern.com> References: <120627105032.ZM25924@torch.brasslantern.com> Date: Wed, 27 Jun 2012 19:58:25 +0200 Message-ID: Subject: Re: typeset -F3 SECONDS doesn't work the first time From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On 27/06/2012, Bart Schaefer 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