summaryrefslogtreecommitdiff
path: root/term.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2006-10-10 19:00:55 +0000
committerRich Felker <dalias@aerifal.cx>2006-10-10 19:00:55 +0000
commit7e80cc8326ccbdde2ce5917941a1e71814be2df1 (patch)
tree675423783772cb12c0b44291abf747183b0e9771 /term.c
parent0a545de895fb861fac88edea716e0b0a5d52f0ff (diff)
workaround broken glibc wcwidth
Diffstat (limited to 'term.c')
-rw-r--r--term.c4
1 files changed, 3 insertions, 1 deletions
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: