Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Capitalize a parameter containing combined characters



"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