summaryrefslogtreecommitdiffstats
path: root/utf8.c
diff options
context:
space:
mode:
authornicm <nicm>2016-04-29 09:11:19 +0000
committernicm <nicm>2016-04-29 09:11:19 +0000
commit7abdfbe20ed01315d84d5b0f02712bd88d407445 (patch)
tree1a3f65019dbe19ba86760a68ec199c4e7cb68333 /utf8.c
parentdd8ba0b5a8f48d4946f0ed214f189bc7092d5b07 (diff)
OpenBSD wcwidth() is sensible and complete so if it returns -1 it means
that a character is not printable, so return to ignoring such characters.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/utf8.c b/utf8.c
index 22ab62c1..56281aa2 100644
--- a/utf8.c
+++ b/utf8.c
@@ -119,14 +119,6 @@ utf8_width(wchar_t wc)
width = wcwidth(wc);
if (width < 0 || width > 0xff) {
log_debug("Unicode %04x, wcwidth() %d", wc, width);
-
- /*
- * Many platforms have no width for relatively common
- * characters (wcwidth() returns -1); assume width 1 in this
- * case and hope for the best.
- */
- if (width < 0)
- return (1);
return (-1);
}
return (width);