From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3231 invoked by alias); 28 Jun 2012 16:54:44 -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: 30540 Received: (qmail 1851 invoked from network); 28 Jun 2012 16:54:42 -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.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120628095403.ZM27189@torch.brasslantern.com> Date: Thu, 28 Jun 2012 09:54:03 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "Re: typeset -F3 SECONDS doesn't work the first time" (Jun 27, 7:58pm) References: <120627105032.ZM25924@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: typeset -F3 SECONDS doesn't work the first time MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jun 27, 7:58pm, Mikael Magnusson wrote: } } > } 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. I've now tried this with various typeset flags, assigning a value to SECONDS in the typeset call, etc., and haven't gotten it to break. Is there any circumstance in which setsparam() [which is a macro around assignsparam()] could render pm invalid? It doesn't look like it from examination of the code, but maybe this should be } else if (!setsecondstype(pm, on, off)) { if (value && !(pm = setsparam(pname, ztrdup(value)))) return NULL; usepm = 1; err = 0; } (Note the assignment to pm.) Aside: Exporting SECONDS doesn't do what you might think. The value at the time of the export is enshrined in the environment and never changes, and is thereafter the starting clock for newly-started shells.