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 <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2013-08-18 01:17:34 +01:00
parent 1e6f6cdb84
commit 5721ea5753
1 changed files with 2 additions and 0 deletions

View File

@ -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, '^');
}