From 7e80cc8326ccbdde2ce5917941a1e71814be2df1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 10 Oct 2006 19:00:55 +0000 Subject: workaround broken glibc wcwidth --- term.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/term.c b/term.c index 3cce287..4f6dda6 100644 --- a/term.c +++ b/term.c @@ -377,7 +377,9 @@ static void process_char(struct uuterm *t, unsigned c) escape(t, c); return; } - switch(w=wcwidth(c)) { + if (iswcntrl(c)) w = -1; + else if ((w = wcwidth(c)) < 0) w = 1; + switch(w) { case -1: switch (c) { case 033: -- cgit v1.2.3