From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17816 invoked from network); 8 Jan 2006 18:03:24 -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; 8 Jan 2006 18:03:24 -0000 Received: (qmail 86748 invoked from network); 8 Jan 2006 18:03:18 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Jan 2006 18:03:18 -0000 Received: (qmail 9048 invoked by alias); 8 Jan 2006 18:03:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22144 Received: (qmail 9038 invoked from network); 8 Jan 2006 18:03:16 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 8 Jan 2006 18:03:16 -0000 Received: (qmail 86468 invoked from network); 8 Jan 2006 18:03:15 -0000 Received: from mta08-winn.ispmail.ntl.com (81.103.221.48) by a.mx.sunsite.dk with SMTP; 8 Jan 2006 18:03:14 -0000 Received: from aamta12-winn.ispmail.ntl.com ([81.103.221.35]) by mta08-winn.ispmail.ntl.com with ESMTP id <20060108180313.JPDE17804.mta08-winn.ispmail.ntl.com@aamta12-winn.ispmail.ntl.com> for ; Sun, 8 Jan 2006 18:03:13 +0000 Received: from pwslaptop.csr.com ([81.105.238.64]) by aamta12-winn.ispmail.ntl.com with SMTP id <20060108180313.VEGX20369.aamta12-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Sun, 8 Jan 2006 18:03:13 +0000 Date: Sun, 8 Jan 2006 18:03:09 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: bug in completion/expansion of files with LANG=C Message-Id: <20060108180309.01082ac4.p.w.stephenson@ntlworld.com> In-Reply-To: <20060108080621.GA32692@dot.blorf.net> References: <20060106215829.GG10111@dot.blorf.net> <20060107224447.GA30232@dot.blorf.net> <1060108055620.ZM15382@candle.brasslantern.com> <20060108080621.GA32692@dot.blorf.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 8 Jan 2006 00:06:21 -0800 Wayne Davison wrote: > As for my patch in the grandparent email, I noticed some problems with > it: the manpage for mbrtowc() says that the state of the mbstate_t > object is undefined after the function returns -1, so the code should > reset it to a known state. When the function returns -2, it means the > code scanned to the end of the string without finding the end of a wide > character, so perhaps we should treat all the remaining characters as > invalid? You mean output everything remaining in the string as special codes rather than real (multibyte) characters? Yes, that would make sense. > 1. It looks to me like the code in wcs_nicechar() that calls > wcswidth(&c, 1) could really just call wcwidth(c), right? If not, > what am I missing? Yes, and it's the only occurrence of wcswidth(), so it would make sense to remove it. This would make my patch for probing for wcswidth() redundant. > 2. The code in mb_niceformat() calls strlen() on the "fmt" string > returned by wcs_nicechar(), but it seems to me that it could just use > the width that wcs_nicechar() returned, right? I think it really needs the length of the string here. The width produced by wcs_nicechar() is a printing width, which isn't the same. -- Peter Stephenson Web page still at http://www.pwstephenson.fsnet.co.uk/