From 090782f5d5974c14eaa0ed4cb3e2c46c8f3166a4 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Fri, 15 Dec 2006 17:47:25 +0000 Subject: [PATCH] Fix the fix in rev. 1.15 so that we jump to the next column instead of always skipping it. MFC after: 3 days --- usr.bin/column/column.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/column/column.c b/usr.bin/column/column.c index ca2837dd5a68..329cfa932ee5 100644 --- a/usr.bin/column/column.c +++ b/usr.bin/column/column.c @@ -141,7 +141,7 @@ main(int argc, char **argv) if (!entries) exit(eval); - maxlength = roundup(maxlength + TAB, TAB); + maxlength = roundup(maxlength + 1, TAB); if (tflag) maketbl(); else if (maxlength >= termwidth) @@ -171,7 +171,7 @@ c_columnate(void) endcol = maxlength; putwchar('\n'); } else { - while ((cnt = roundup(chcnt + TAB, TAB)) <= endcol) { + while ((cnt = roundup(chcnt + 1, TAB)) <= endcol) { (void)putwchar('\t'); chcnt = cnt; } @@ -199,7 +199,7 @@ r_columnate(void) chcnt += width(list[base]); if ((base += numrows) >= entries) break; - while ((cnt = roundup(chcnt + TAB, TAB)) <= endcol) { + while ((cnt = roundup(chcnt + 1, TAB)) <= endcol) { (void)putwchar('\t'); chcnt = cnt; }