diff options
author | ache <ache@FreeBSD.org> | 2000-06-06 12:10:07 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2000-06-06 12:10:07 +0000 |
commit | bd7aee03b640ad60bf49b0cf55c67ca014cf1d8d (patch) | |
tree | a08721bf2d730bc87ecfa5daffadc73e27e0f8be /bin/ls | |
parent | 4a75312ccc11f08e45d0adcc471e7ce6e087ff01 (diff) | |
download | FreeBSD-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/ls')
-rw-r--r-- | bin/ls/print.c | 13 |
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'); |