summaryrefslogtreecommitdiff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-04-22 15:08:04 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-04-22 15:08:04 +0000
commit2cec7aae44579d9d8ca8c7e728f9eb6e2840d72f (patch)
treea1725b9e9fba5cc1959b029167bd8137183cf092 /Src/utils.c
parenta58d02fd2e11f8453b912859b2f774b6cadace4c (diff)
downloadzsh-2cec7aae44579d9d8ca8c7e728f9eb6e2840d72f.tar.gz
zsh-2cec7aae44579d9d8ca8c7e728f9eb6e2840d72f.zip
24861 (with tweaks): logic to use alternative wcwidth() if needed;
slightly improve test for overwriting with combining characters.
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c6
1 files changed, 3 insertions, 3 deletions
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