1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-17 15:01:40 +02:00

Small fix to 23177: compute *widthp and *swidep after nicechar().

This commit is contained in:
Bart Schaefer 2007-02-26 18:47:25 +00:00
parent 9b1663b531
commit 07c5aeeb9a

View file

@ -519,7 +519,16 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep)
if (widthp) if (widthp)
*widthp = 6; *widthp = 6;
} else { } else {
return nicechar((int)c); strcpy(buf, nicechar((int)c));
/*
* There may be metafied characters from nicechar(),
* so compute width and end position independently.
*/
if (widthp)
*widthp = ztrlen(buf);
if (swidep)
*swidep = buf + strlen(buf);
return buf;
} }
if (swidep) if (swidep)
*swidep = buf + *widthp; *swidep = buf + *widthp;