From 2cec7aae44579d9d8ca8c7e728f9eb6e2840d72f Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 22 Apr 2008 15:08:04 +0000 Subject: 24861 (with tweaks): logic to use alternative wcwidth() if needed; slightly improve test for overwriting with combining characters. --- Src/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Src/utils.c') diff --git a/Src/utils.c b/Src/utils.c index 24e709c24..30162a71e 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -548,7 +548,7 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep) } if (widthp) { - int wcw = wcwidth(c); + int wcw = WCWIDTH(c); *widthp = (s - buf); if (wcw >= 0) *widthp += wcw; @@ -581,7 +581,7 @@ zwcwidth(wint_t wc) /* assume a single-byte character if not valid */ if (wc == WEOF || unset(MULTIBYTE)) return 1; - wcw = wcwidth(wc); + wcw = WCWIDTH(wc); /* if not printable, assume width 1 */ if (wcw < 0) return 1; @@ -4097,7 +4097,7 @@ mb_metastrlen(char *ptr, int width) * Returns -1 if not a printable character. We * turn this into 1 for backward compatibility. */ - int wcw = wcwidth(wc); + int wcw = WCWIDTH(wc); if (wcw >= 0) num += wcw; else -- cgit 1.4.1