diff options
Diffstat (limited to 'bin/ls')
-rw-r--r-- | bin/ls/ls.c | 11 | ||||
-rw-r--r-- | bin/ls/print.c | 13 |
2 files changed, 10 insertions, 14 deletions
diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 84bc730..ac63133 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -298,6 +298,12 @@ main(argc, argv) #ifdef COLORLS if (f_color) { + /* + * We can't put tabs and color sequences together: + * column number will be incremented incorrectly + * for "stty oxtabs" mode. + */ + f_notabs = 1; (void) signal(SIGINT, colorquit); (void) signal(SIGQUIT, colorquit); parsecolors(getenv("LSCOLORS")); @@ -521,7 +527,10 @@ display(p, list) case 4: maxgroup = 0; case 5: maxflags = 0; case 6: maxsize = 0; - case 7: maxlen = 0, f_notabs = 0; + case 7: maxlen = 0; +#ifndef COLORLS + f_notabs = 0; +#endif } maxinode = makenines(maxinode); maxblock = makenines(maxblock); diff --git a/bin/ls/print.c b/bin/ls/print.c index e55fa5f..596825c 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -241,19 +241,6 @@ 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 && !f_notabs) - while ((cnt = (chcnt + 1)) <= endcol) { - (void)putchar(' '); - chcnt = cnt; - } - else -#endif while ((cnt = ((chcnt + tabwidth) & ~(tabwidth - 1))) <= endcol){ (void)putchar(f_notabs ? ' ' : '\t'); |