]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wall: line wrap at column 79 also when line has tab chars
authorSami Kerola <kerolasa@iki.fi>
Sun, 18 Aug 2013 00:17:34 +0000 (01:17 +0100)
committerSami Kerola <kerolasa@iki.fi>
Thu, 29 Aug 2013 17:14:07 +0000 (18:14 +0100)
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>
term-utils/wall.c

index 451b5d31a443ce469754f3341557b74924500f9d..fbea7e42f2aa4c1ac113d214b75cdabc7a53e63c 100644 (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, '^');
                        }