Fix the fix in rev. 1.15 so that we jump to the next column

instead of always skipping it.

MFC after:	3 days
This commit is contained in:
Ruslan Ermilov 2006-12-15 17:47:25 +00:00
parent e0195199f7
commit 090782f5d5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165249

View File

@ -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;
}