commit 6f02addad1b6c1f13090d951703a00edba6662c3
parent 74676ddd350816d7c6bdd5ef274a8c66ae49d105
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:
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
}