From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15488 invoked from network); 26 Feb 2007 16:15:28 -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:15:28 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 37549 invoked from network); 26 Feb 2007 16:15:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Feb 2007 16:15:22 -0000 Received: (qmail 16957 invoked by alias); 26 Feb 2007 16:15:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23191 Received: (qmail 16948 invoked from network); 26 Feb 2007 16:15:18 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Feb 2007 16:15:18 -0000 Received: (qmail 37133 invoked from network); 26 Feb 2007 16:15:18 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 26 Feb 2007 16:15:12 -0000 Received: from torch.brasslantern.com ([71.116.117.231]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JE200JVQVQLSN7B@vms040.mailsrvcs.net> for zsh-workers@sunsite.dk; Mon, 26 Feb 2007 10:13:34 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id l1QGDXrN009906 for ; Mon, 26 Feb 2007 08:13:33 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id l1QGDWTa009905 for zsh-workers@sunsite.dk; Mon, 26 Feb 2007 08:13:32 -0800 Date: Mon, 26 Feb 2007 08:13:32 -0800 From: Bart Schaefer Subject: Re: Quoting problem and crashes with ${(#)var} In-reply-to: <200702261034.l1QAY1fs004257@news01.csr.com> To: zsh-workers@sunsite.dk Message-id: <070226081332.ZM9904@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii 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> Comments: In reply to Peter Stephenson "Re: Quoting problem and crashes with ${(#)var}" (Feb 26, 10:34am) On Feb 26, 10:34am, Peter Stephenson wrote: } Subject: Re: Quoting problem and crashes with ${(#)var} } } Bart Schaefer wrote: } > + 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. 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. } 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. I'm more worried about embedded nuls, really, but that should be OK. I'll go ahead and commit it as above.