summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2000-06-06 12:44:29 +0000
committerache <ache@FreeBSD.org>2000-06-06 12:44:29 +0000
commit21eb10009f66492192b39ddbfb8d444669237149 (patch)
treeb18ce0601e4d1da959134b805e937a55bdb0d2fb /bin
parent1bb87dcd8c54dc505c30179881663e59d80c69d4 (diff)
downloadFreeBSD-src-21eb10009f66492192b39ddbfb8d444669237149.zip
FreeBSD-src-21eb10009f66492192b39ddbfb8d444669237149.tar.gz
Greately simplify oxtabs fix by simple setting f_notabs for f_color
Diffstat (limited to 'bin')
-rw-r--r--bin/ls/ls.c11
-rw-r--r--bin/ls/print.c13
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');
OpenPOWER on IntegriCloud