1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-06 09:17:25 +00:00

Greately simplify oxtabs fix by simple setting f_notabs for f_color

This commit is contained in:
Andrey A. Chernov 2000-06-06 12:44:29 +00:00
parent 322b47fd88
commit 22ff3e9e29
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61337
2 changed files with 10 additions and 14 deletions

View File

@ -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);

View File

@ -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');