From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1214 invoked from network); 14 Feb 2007 16:20:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) 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.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 Feb 2007 16:20:28 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 2951 invoked from network); 14 Feb 2007 16:20:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Feb 2007 16:20:22 -0000 Received: (qmail 16041 invoked by alias); 14 Feb 2007 16:20:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23177 Received: (qmail 16032 invoked from network); 14 Feb 2007 16:20:18 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 14 Feb 2007 16:20:18 -0000 Received: (qmail 2599 invoked from network); 14 Feb 2007 16:20:18 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 14 Feb 2007 16:20:12 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly37d.srv.mailcontrol.com (MailControl) with ESMTP id l1EGJo88026017 for ; Wed, 14 Feb 2007 16:20:06 GMT Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Wed, 14 Feb 2007 16:19:57 +0000 Date: Wed, 14 Feb 2007 16:19:51 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: Quoting problem and crashes with ${(#)var} Message-Id: <20070214161951.e8219d6c.pws@csr.com> In-Reply-To: <070214080347.ZM26428@torch.brasslantern.com> References: <200702132111.l1DLB5rA003849@pwslaptop.csr.com> <070213234815.ZM5424@torch.brasslantern.com> <200702141016.l1EAGpKF016735@news01.csr.com> <070214080347.ZM26428@torch.brasslantern.com> Organization: Cambridge Silicon Radio X-Mailer: Sylpheed version 2.2.10 (GTK+ 2.10.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 14 Feb 2007 16:19:57.0230 (UTC) FILETIME=[F7BE4CE0:01C75053] X-Scanned-By: MailControl A-07-06-80 (www.mailcontrol.com) on 10.68.0.147 Bart Schaefer wrote: > } Passing the character through the appropriate version of nicechar() > } ought to help. > > Unfortunately that doesn't seem to be enough: the (V) flag is already > calling nicedupstring(). It looks like wcs_nicechar() only uses the > carat-character format for control characters less than 0x80? ZLE > must be doing its own printable conversion somewhere else. Ah. Try this. Yes, I wasn't using "print -r", so the \u code got converted back to a raw character. Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.156 diff -u -r1.156 utils.c --- Src/utils.c 12 Feb 2007 16:43:42 -0000 1.156 +++ Src/utils.c 14 Feb 2007 16:18:14 -0000 @@ -514,10 +514,12 @@ sprintf(buf, "\\U%.8x", (unsigned int)c); if (widthp) *widthp = 10; - } else { + } else if (c >= 0x100) { sprintf(buf, "\\u%.4x", (unsigned int)c); if (widthp) *widthp = 6; + } else { + return nicechar((int)c); } if (swidep) *swidep = buf + *widthp; -- 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