diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2000-06-06 12:10:07 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2000-06-06 12:10:07 +0000 |
commit | 6cd5adff753df6f3b3fba241d8b59340256d9e60 (patch) | |
tree | 4b480dfd1af1c6233a058abece92b043b028e911 /bin/ls | |
parent | aaf8e0820547d57210b03321440f952ba1e5dc10 (diff) | |
download | src-6cd5adff753df6f3b3fba241d8b59340256d9e60.tar.gz src-6cd5adff753df6f3b3fba241d8b59340256d9e60.zip |
Back out spaces to TABs replace removing for COLORLS
Rewrite corresponding comment to say what happens in reality with oxtabs
and current terminal column.
Notes
Notes:
svn path=/head/; revision=61334
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 596825c7d7d8..ec4deb519a00 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'); |