default to character width 1 - sob - simple output bar
HTML git clone git://git.codemadness.org/sob
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 6f02addad1b6c1f13090d951703a00edba6662c3
DIR parent 74676ddd350816d7c6bdd5ef274a8c66ae49d105
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 26 Oct 2014 12:01:22 +0000
default to character width 1
if wcwidth() == -1, default to character width 1 (usual case).
with glibc: printf '\xd4\xa4' | sob
Diffstat:
M sob.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/sob.c b/sob.c
@@ -116,7 +116,7 @@ colw(const char *s, size_t max)
if((r = mbtowc(&w, s, i + 4 > max ? max - i : 4)) == -1)
break;
if((r = wcwidth(w)) == -1)
- break;
+ r = 1;
len += r;
}
}