Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Capitalize a parameter containing combined characters
- X-seq: zsh-workers 24873
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: Capitalize a parameter containing combined characters
- Date: Sat, 26 Apr 2008 19:13:00 +0100
- In-reply-to: Message from "Jun T." <takimoto-j@xxxxxxxxxxxxxxxxx> of "Sun, 27 Apr 2008 02:39:38 +0900." <4CB683B0-AA0B-45C1-BC88-29DF5ADFD5F4@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
"Jun T." wrote:
> I did some quick tests of parameter expansion with combined characters,
> and found a small bug:
> --- Src/hist.c 17 Apr 2008 10:23:53 -0000 1.75
> +++ Src/hist.c 26 Apr 2008 16:53:56 -0000
> @@ -1567,6 +1567,8 @@
>
> case CASMOD_CAPS:
> default: /* shuts up compiler */
> + if (IS_COMBINING(wc))
> + break;
> if (!iswalnum(wc))
> nextupper = 1;
> else if (nextupper) {
>
IS_COMBINING() is only defined in the multibyte world, so it needs to
be as follows.
Index: Src/hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/hist.c,v
retrieving revision 1.75
diff -u -r1.75 hist.c
--- Src/hist.c 17 Apr 2008 10:23:53 -0000 1.75
+++ Src/hist.c 26 Apr 2008 18:12:45 -0000
@@ -1567,6 +1567,10 @@
case CASMOD_CAPS:
default: /* shuts up compiler */
+#ifdef MULTIBYTE_SUPPORT
+ if (IS_COMBINING(wc))
+ break;
+#endif
if (!iswalnum(wc))
nextupper = 1;
else if (nextupper) {
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author