From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2810 invoked from network); 13 Jan 2006 09:48:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Jan 2006 09:48:16 -0000 Received: (qmail 40325 invoked from network); 13 Jan 2006 09:48:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Jan 2006 09:48:03 -0000 Received: (qmail 1909 invoked by alias); 13 Jan 2006 09:47:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22162 Received: (qmail 1898 invoked from network); 13 Jan 2006 09:47:59 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Jan 2006 09:47:59 -0000 Received: (qmail 40045 invoked from network); 13 Jan 2006 09:47:59 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO dot.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 13 Jan 2006 09:47:57 -0000 Received: by dot.blorf.net (Postfix, from userid 1000) id 0DBEC95B0; Fri, 13 Jan 2006 01:47:56 -0800 (PST) Date: Fri, 13 Jan 2006 01:47:56 -0800 From: Wayne Davison To: zsh-workers@sunsite.dk Subject: Re: mangling of non-ascii char in prompt Message-ID: <20060113094755.GA1852@dot.blorf.net> References: <20060112022950.GA24042@scowler.net> <20060113022347.GA32762@dot.blorf.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: <20060113022347.GA32762@dot.blorf.net> User-Agent: Mutt/1.5.11 --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 12, 2006 at 06:23:47PM -0800, Wayne Davison wrote: > The problem appears to be that the UTF-8 string coming from %D{%a} is > not being metafied Attached are some fixes I just checked in. They fix this problem in the prompt, and some similar problems in the zsh/datetime and zsh/stat modules, both of which needed to metafy values when they were put into variables. ..wayne.. --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="meta.patch" --- prompt.c 12 Jan 2006 00:51:41 -0000 1.32 +++ prompt.c 13 Jan 2006 09:43:46 -0000 1.34 @@ -543,6 +543,9 @@ putpromptchar(int doprint, int endchar) if (ztrftime(bp, t0, tmfmt, tm) >= 0) break; } + /* There is enough room for this because addbufspc(t0) + * allocates room for t0 * 2 bytes. */ + metafy(bp, -1, META_NOALLOC); bp += strlen(bp); free(tmbuf); tmbuf = NULL; --- Modules/datetime.c 7 Dec 2004 16:55:10 -0000 1.11 +++ Modules/datetime.c 13 Jan 2006 09:02:43 -0000 1.12 @@ -67,7 +67,7 @@ bin_strftime(char *nam, char **argv, Opt } if (scalar) { - setsparam(scalar, ztrdup(buffer)); + setsparam(scalar, metafy(buffer, -1, META_DUP)); } else { printf("%s\n", buffer); } --- Modules/stat.c 19 Dec 2005 11:35:44 -0000 1.10 +++ Modules/stat.c 13 Jan 2006 09:15:59 -0000 1.11 @@ -570,11 +570,11 @@ bin_stat(char *name, char **args, Option if (iwhich > -1) { statprint(&statbuf, outbuf, *args, iwhich, flags); if (arrnam) - *arrptr++ = ztrdup(outbuf); + *arrptr++ = metafy(outbuf, -1, META_DUP); else if (hashnam) { /* STF_NAME explicitly turned off for ops.ind['H'] above */ *hashptr++ = ztrdup(statelts[iwhich]); - *hashptr++ = ztrdup(outbuf); + *hashptr++ = metafy(outbuf, -1, META_DUP); } else printf("%s\n", outbuf); } else { @@ -582,11 +582,11 @@ bin_stat(char *name, char **args, Option for (i = 0; i < ST_COUNT; i++) { statprint(&statbuf, outbuf, *args, i, flags); if (arrnam) - *arrptr++= ztrdup(outbuf); + *arrptr++= metafy(outbuf, -1, META_DUP); else if (hashnam) { /* STF_NAME explicitly turned off for ops.ind['H'] above */ *hashptr++ = ztrdup(statelts[i]); - *hashptr++ = ztrdup(outbuf); + *hashptr++ = metafy(outbuf, -1, META_DUP); } else printf("%s\n", outbuf); } --x+6KMIRAuhnl3hBn--