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

Re: Quoting problem and crashes with ${(#)var}



(Just back from a week-long vacation trip.)

On Feb 14,  4:19pm, Peter Stephenson wrote:
} Subject: Re: Quoting problem and crashes with ${(#)var}
}
} Ah.  Try this.

It's broken -- it doesn't set *widthp and *swidep when returning
nicechar().

I'm not certain the following is the right way to fix it; is something
more wide-char-aware than strcpy/strlen needed?  
 

--- ../zsh-forge/current/Src/utils.c	2007-02-25 14:06:38.000000000 -0800
+++ Src/utils.c	2007-02-25 15:01:14.000000000 -0800
@@ -519,7 +519,9 @@
 	    if (widthp)
 		*widthp = 6;
 	} else {
-	    return nicechar((int)c);
+	    strcpy(buf, nicechar((int)c));
+	    if (widthp)
+		*widthp = strlen(buf);
 	}
 	if (swidep)
 	    *swidep = buf + *widthp;



Messages sorted by: Reverse Date, Date, Thread, Author