From 07c5aeeb9a85d63fb15bd38b82fa55671b039ead Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 26 Feb 2007 18:47:25 +0000 Subject: Small fix to 23177: compute *widthp and *swidep after nicechar(). --- Src/utils.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Src') diff --git a/Src/utils.c b/Src/utils.c index e6eb69f01..0e8404209 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -519,7 +519,16 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep) if (widthp) *widthp = 6; } 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) *swidep = buf + *widthp; -- cgit 1.4.1