From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13763 invoked from network); 26 Feb 2007 16:24:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Feb 2007 16:24:41 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 49074 invoked from network); 26 Feb 2007 16:24:36 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Feb 2007 16:24:36 -0000 Received: (qmail 19824 invoked by alias); 26 Feb 2007 16:24:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23192 Received: (qmail 19815 invoked from network); 26 Feb 2007 16:24:33 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Feb 2007 16:24:33 -0000 Received: (qmail 48771 invoked from network); 26 Feb 2007 16:24:33 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 26 Feb 2007 16:24:27 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly06d.srv.mailcontrol.com (MailControl) with ESMTP id l1QGOPSI022897 for ; Mon, 26 Feb 2007 16:24:26 GMT Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Mon, 26 Feb 2007 16:24:25 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.8/8.13.4) with ESMTP id l1QGOFhu007503 for ; Mon, 26 Feb 2007 16:24:15 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.8/8.13.8/Submit) with ESMTP id l1QGOFWp007499 for ; Mon, 26 Feb 2007 16:24:15 GMT Message-Id: <200702261624.l1QGOFWp007499@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: Quoting problem and crashes with ${(#)var} In-reply-to: <070226081332.ZM9904@torch.brasslantern.com> References: <200702132111.l1DLB5rA003849@pwslaptop.csr.com> <070213234815.ZM5424@torch.brasslantern.com> <200702141016.l1EAGpKF016735@news01.csr.com> <070214080347.ZM26428@torch.brasslantern.com> <20070214161951.e8219d6c.pws@csr.com> <070225151543.ZM32724@torch.brasslantern.com> <200702261034.l1QAY1fs004257@news01.csr.com> <070226081332.ZM9904@torch.brasslantern.com> Comments: In-reply-to Bart Schaefer message dated "Mon, 26 Feb 2007 08:13:32 -0800." Date: Mon, 26 Feb 2007 16:24:15 +0000 From: Peter Stephenson X-OriginalArrivalTime: 26 Feb 2007 16:24:25.0637 (UTC) FILETIME=[94AEF550:01C759C2] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-06-00 (www.mailcontrol.com) on 10.68.0.116 Bart Schaefer wrote: > } > + *widthp = strlen(buf); > } > } If printeightbit is set, then nicechar() may pass 8-bit characters, > } which may be metafied, straight through, so ztrlen() is probably better. > } printeightbit doesn't guaranteed to get character lengths right, but > } counting metafied characters as 1 is more consistent. > > That may be more consistent, but a bit later on the same function computes > (*swidep = buf + *widthp) so I think what's wanted here is the actual > width rather than the visible width. That's true for swidep, it needs to point (in this case) to the NULL at then end (as there's not wide character following). However, *widthp does need to be ztrlen(). So I think it they need to be separate. (Before that nicechar() was added there couldn't be any metafied characters at this point.) pws To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview