From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22231 invoked from network); 26 Feb 2007 10:34:34 -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 10:34:34 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 4277 invoked from network); 26 Feb 2007 10:34:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Feb 2007 10:34:28 -0000 Received: (qmail 3089 invoked by alias); 26 Feb 2007 10:34:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23189 Received: (qmail 3080 invoked from network); 26 Feb 2007 10:34:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Feb 2007 10:34:25 -0000 Received: (qmail 3991 invoked from network); 26 Feb 2007 10:34:25 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 26 Feb 2007 10:34:18 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly04c.srv.mailcontrol.com (MailControl) with ESMTP id l1QAWl1k016817 for ; Mon, 26 Feb 2007 10:34:12 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 10:34:08 +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 l1QAY1oW004260 for ; Mon, 26 Feb 2007 10:34:01 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.8/8.13.8/Submit) with ESMTP id l1QAY1fs004257 for ; Mon, 26 Feb 2007 10:34:01 GMT Message-Id: <200702261034.l1QAY1fs004257@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: <070225151543.ZM32724@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> Comments: In-reply-to Bart Schaefer message dated "Sun, 25 Feb 2007 15:15:43 -0800." Date: Mon, 26 Feb 2007 10:34:01 +0000 From: Peter Stephenson X-OriginalArrivalTime: 26 Feb 2007 10:34:08.0734 (UTC) FILETIME=[A5A20FE0:01C75991] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-06-90 (www.mailcontrol.com) on 10.67.0.114 Bart Schaefer wrote: > I'm not certain the following is the right way to fix it; is something > more wide-char-aware than strcpy/strlen needed? > > - return nicechar((int)c); > + strcpy(buf, nicechar((int)c)); > + if (widthp) > + *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. I don't think we need to take account of wide characters here; we don't have the information for that in this branch of the code. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 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