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:
parent
322b47fd88
commit
22ff3e9e29
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61337
11
bin/ls/ls.c
11
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);
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user