summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2000-06-06 12:10:07 +0000
committerache <ache@FreeBSD.org>2000-06-06 12:10:07 +0000
commitbd7aee03b640ad60bf49b0cf55c67ca014cf1d8d (patch)
treea08721bf2d730bc87ecfa5daffadc73e27e0f8be /bin
parent4a75312ccc11f08e45d0adcc471e7ce6e087ff01 (diff)
downloadFreeBSD-src-bd7aee03b640ad60bf49b0cf55c67ca014cf1d8d.zip
FreeBSD-src-bd7aee03b640ad60bf49b0cf55c67ca014cf1d8d.tar.gz
Back out spaces to TABs replace removing for COLORLS
Rewrite corresponding comment to say what happens in reality with oxtabs and current terminal column.
Diffstat (limited to 'bin')
-rw-r--r--bin/ls/print.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c
index 596825c..ec4deb5 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -241,6 +241,19 @@ printcol(dp)
dp->s_block);
if ((base += numrows) >= num)
break;
+#ifdef COLORLS
+ /*
+ * We can't put tabs and color sequences together:
+ * column number will be incremented incorrectly
+ * for "stty oxtabs" mode.
+ */
+ if (f_color)
+ while ((cnt = (chcnt + 1)) <= endcol) {
+ (void)putchar(' ');
+ chcnt = cnt;
+ }
+ else
+#endif
while ((cnt = ((chcnt + tabwidth) & ~(tabwidth - 1)))
<= endcol){
(void)putchar(f_notabs ? ' ' : '\t');
OpenPOWER on IntegriCloud