From: Lennart Poettering Date: Fri, 26 Apr 2024 15:41:15 +0000 (+0200) Subject: utf8: assume tabs are 8 characters wide when written to console X-Git-Tag: v257-rc1~1159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4aaba2bb0091d50cbb5ef60afd04d4f6bbee456;p=thirdparty%2Fsystemd.git utf8: assume tabs are 8 characters wide when written to console --- diff --git a/src/basic/utf8.c b/src/basic/utf8.c index 36f0dc9cfd3..b5711f43001 100644 --- a/src/basic/utf8.c +++ b/src/basic/utf8.c @@ -187,6 +187,9 @@ static int utf8_char_console_width(const char *str) { if (r < 0) return r; + if (c == '\t') + return 8; /* Assume a tab width of 8 */ + /* TODO: we should detect combining characters */ return unichar_iswide(c) ? 2 : 1;