From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3036 invoked from network); 25 Feb 2007 23:16:07 -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; 25 Feb 2007 23:16:07 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 18422 invoked from network); 25 Feb 2007 23:16:01 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Feb 2007 23:16:01 -0000 Received: (qmail 17786 invoked by alias); 25 Feb 2007 23:15:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23187 Received: (qmail 17777 invoked from network); 25 Feb 2007 23:15:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 25 Feb 2007 23:15:58 -0000 Received: (qmail 18072 invoked from network); 25 Feb 2007 23:15:58 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 25 Feb 2007 23:15:50 -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 <0JE100JIOKM8SNZ8@vms040.mailsrvcs.net> for zsh-workers@sunsite.dk; Sun, 25 Feb 2007 17:15:45 -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 l1PNFiaZ032726 for ; Sun, 25 Feb 2007 15:15:44 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id l1PNFh0v032725 for zsh-workers@sunsite.dk; Sun, 25 Feb 2007 15:15:43 -0800 Date: Sun, 25 Feb 2007 15:15:43 -0800 From: Bart Schaefer Subject: Re: Quoting problem and crashes with ${(#)var} In-reply-to: <20070214161951.e8219d6c.pws@csr.com> To: zsh-workers@sunsite.dk Message-id: <070225151543.ZM32724@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> Comments: In reply to Peter Stephenson "Re: Quoting problem and crashes with ${(#)var}" (Feb 14, 4:19pm) (Just back from a week-long vacation trip.) On Feb 14, 4:19pm, Peter Stephenson wrote: } Subject: Re: Quoting problem and crashes with ${(#)var} } } Ah. Try this. It's broken -- it doesn't set *widthp and *swidep when returning nicechar(). I'm not certain the following is the right way to fix it; is something more wide-char-aware than strcpy/strlen needed? --- ../zsh-forge/current/Src/utils.c 2007-02-25 14:06:38.000000000 -0800 +++ Src/utils.c 2007-02-25 15:01:14.000000000 -0800 @@ -519,7 +519,9 @@ if (widthp) *widthp = 6; } else { - return nicechar((int)c); + strcpy(buf, nicechar((int)c)); + if (widthp) + *widthp = strlen(buf); } if (swidep) *swidep = buf + *widthp;