Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: assume "enhanced goodness" when --multibyte-enable
- X-seq: zsh-workers 22075
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: PATCH: assume "enhanced goodness" when --multibyte-enable
- Date: Wed, 14 Dec 2005 18:22:25 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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 <pws@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author