From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21525 invoked from network); 14 Dec 2005 18:24:45 -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; 14 Dec 2005 18:24:45 -0000 Received: (qmail 40860 invoked from network); 14 Dec 2005 18:24:40 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Dec 2005 18:24:39 -0000 Received: (qmail 4477 invoked by alias); 14 Dec 2005 18:24:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22075 Received: (qmail 4468 invoked from network); 14 Dec 2005 18:24:36 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 14 Dec 2005 18:24:36 -0000 Received: (qmail 40570 invoked from network); 14 Dec 2005 18:24:36 -0000 Received: from cluster-d.mailcontrol.com (HELO rly06d.srv.mailcontrol.com) (217.69.20.190) by a.mx.sunsite.dk with SMTP; 14 Dec 2005 18:24:33 -0000 Received: from exchange03.csr.com (uuk202166.uk.customer.alter.net [62.189.241.194] (may be forged)) by rly06d.srv.mailcontrol.com (MailControl) with ESMTP id jBEIKKCv004031 for ; Wed, 14 Dec 2005 18:24:31 GMT Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 14 Dec 2005 18:22:31 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.1/8.12.11) with ESMTP id jBEIMSJD027537 for ; Wed, 14 Dec 2005 18:22:30 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.1/8.13.1/Submit) with ESMTP id jBEIMPjF027531 for ; Wed, 14 Dec 2005 18:22:28 GMT Message-Id: <200512141822.jBEIMPjF027531@news01.csr.com> To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: assume "enhanced goodness" when --multibyte-enable Date: Wed, 14 Dec 2005 18:22:25 +0000 From: Peter Stephenson X-OriginalArrivalTime: 14 Dec 2005 18:22:31.0583 (UTC) FILETIME=[58E442F0:01C600DB] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-05-40-01 (www.mailcontrol.com) on 10.68.0.116 In utils.c we don't enable the full multibyte code for converting characters unless __STDC_ISO_10646__ is turned on. However, everywhere in zle we simply trust that if --multibyte-enable is turned on everything just works. That includes wctomb(), which is all we need for character conversion. Hence I think we need to make the same assumption in utils.c, too. This makes things (in particular insert-{composed,unicode}-char) work better on Solaris 8. Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.105 diff -u -r1.105 utils.c --- Src/utils.c 30 Nov 2005 16:35:33 -0000 1.105 +++ Src/utils.c 14 Dec 2005 18:17:29 -0000 @@ -3918,7 +3918,7 @@ } #endif -# if defined(HAVE_NL_LANGINFO) && defined(CODESET) && !defined(__STDC_ISO_10646__) +# if defined(HAVE_NL_LANGINFO) && defined(CODESET) && !defined(__STDC_ISO_10646__) && !defined(MULTIBYTE_SUPPORT) /* Convert a character from UCS4 encoding to UTF-8 */ /**/ @@ -3984,7 +3984,7 @@ char svchar = '\0'; int meta = 0, control = 0; int i; -#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) && defined(__STDC_ISO_10646__) +#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) && (defined(__STDC_ISO_10646__) || defined(MULTIBYTE_SUPPORT)) wint_t wval; size_t count; #else @@ -4093,7 +4093,7 @@ *misc = wval; return s+1; } -#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) && defined(__STDC_ISO_10646__) +#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) && (defined(__STDC_ISO_10646__) || defined(MULTIBYTE_SUPPORT)) count = wctomb(t, (wchar_t)wval); if (count == (size_t)-1) { zerr("character not in range", NULL, 0); -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com