From: Sami Kerola Date: Sun, 18 Aug 2013 00:17:34 +0000 (+0100) Subject: wall: line wrap at column 79 also when line has tab chars X-Git-Tag: v2.24-rc1~321 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5721ea5753987a0657c47e5e7ab08c8a486c6785;p=thirdparty%2Futil-linux.git wall: line wrap at column 79 also when line has tab chars Earlier tabs caused random ragged right indentation, because the tab length was assumed to be 1 char which is not the case most of the time. Signed-off-by: Sami Kerola --- diff --git a/term-utils/wall.c b/term-utils/wall.c index 451b5d31a4..fbea7e42f2 100644 --- a/term-utils/wall.c +++ b/term-utils/wall.c @@ -281,6 +281,8 @@ static char *makemsg(char *fname, char **mvec, int mvecsz, putc('\n', fp); cnt = 0; } + if (ch == '\t') + cnt += (7 - (cnt % 8)); if (ch != '\n') carefulputc(ch, fp, '^'); }