Replace spaces with tabs where appropriate.

Reminded by: jh@
This commit is contained in:
Greg Lehey 2012-11-08 23:45:19 +00:00
parent 56eaeab499
commit dfd91f79a3
6 changed files with 36 additions and 36 deletions

View File

@ -78,9 +78,9 @@ modcmp(const FTSENT *a, const FTSENT *b)
if (b->fts_statp->st_mtim.tv_nsec < if (b->fts_statp->st_mtim.tv_nsec <
a->fts_statp->st_mtim.tv_nsec) a->fts_statp->st_mtim.tv_nsec)
return (-1); return (-1);
if (f_samesort) if (f_samesort)
return (strcoll(b->fts_name, a->fts_name)); return (strcoll(b->fts_name, a->fts_name));
else else
return (strcoll(a->fts_name, b->fts_name)); return (strcoll(a->fts_name, b->fts_name));
} }
@ -107,9 +107,9 @@ acccmp(const FTSENT *a, const FTSENT *b)
if (b->fts_statp->st_atim.tv_nsec < if (b->fts_statp->st_atim.tv_nsec <
a->fts_statp->st_atim.tv_nsec) a->fts_statp->st_atim.tv_nsec)
return (-1); return (-1);
if (f_samesort) if (f_samesort)
return (strcoll(b->fts_name, a->fts_name)); return (strcoll(b->fts_name, a->fts_name));
else else
return (strcoll(a->fts_name, b->fts_name)); return (strcoll(a->fts_name, b->fts_name));
} }
@ -136,9 +136,9 @@ birthcmp(const FTSENT *a, const FTSENT *b)
if (b->fts_statp->st_birthtim.tv_nsec < if (b->fts_statp->st_birthtim.tv_nsec <
a->fts_statp->st_birthtim.tv_nsec) a->fts_statp->st_birthtim.tv_nsec)
return (-1); return (-1);
if (f_samesort) if (f_samesort)
return (strcoll(b->fts_name, a->fts_name)); return (strcoll(b->fts_name, a->fts_name));
else else
return (strcoll(a->fts_name, b->fts_name)); return (strcoll(a->fts_name, b->fts_name));
} }
@ -165,9 +165,9 @@ statcmp(const FTSENT *a, const FTSENT *b)
if (b->fts_statp->st_ctim.tv_nsec < if (b->fts_statp->st_ctim.tv_nsec <
a->fts_statp->st_ctim.tv_nsec) a->fts_statp->st_ctim.tv_nsec)
return (-1); return (-1);
if (f_samesort) if (f_samesort)
return (strcoll(b->fts_name, a->fts_name)); return (strcoll(b->fts_name, a->fts_name));
else else
return (strcoll(a->fts_name, b->fts_name)); return (strcoll(a->fts_name, b->fts_name));
} }

View File

@ -55,12 +55,12 @@ int prn_octal(const char *);
int prn_printable(const char *); int prn_printable(const char *);
#ifdef COLORLS #ifdef COLORLS
void parsecolors(const char *cs); void parsecolors(const char *cs);
void colorquit(int); void colorquit(int);
extern char *ansi_fgcol; extern char *ansi_fgcol;
extern char *ansi_bgcol; extern char *ansi_bgcol;
extern char *ansi_coloff; extern char *ansi_coloff;
extern char *attrs_off; extern char *attrs_off;
extern char *enter_bold; extern char *enter_bold;
#endif #endif
extern int termwidth; extern int termwidth;

View File

@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$");
#define STRBUF_SIZEOF(t) (1 + CHAR_BIT * sizeof(t) / 3 + 1) #define STRBUF_SIZEOF(t) (1 + CHAR_BIT * sizeof(t) / 3 + 1)
/* /*
* MAKENINES(n) turns n into (10**n)-1. This is useful for converting a width * MAKENINES(n) turns n into (10**n)-1. This is useful for converting a width
* into a number that wide in decimal. * into a number that wide in decimal.
* XXX: Overflows are not considered. * XXX: Overflows are not considered.
*/ */
@ -133,7 +133,7 @@ static int f_sizesort;
int f_statustime; /* use time of last mode change */ int f_statustime; /* use time of last mode change */
static int f_stream; /* stream the output, separate with commas */ static int f_stream; /* stream the output, separate with commas */
int f_thousands; /* show file sizes with thousands separators */ int f_thousands; /* show file sizes with thousands separators */
char *f_timeformat; /* user-specified time format */ char *f_timeformat; /* user-specified time format */
static int f_timesort; /* sort by time vice name */ static int f_timesort; /* sort by time vice name */
int f_type; /* add type character for non-regular files */ int f_type; /* add type character for non-regular files */
static int f_whiteout; /* show whiteout entries */ static int f_whiteout; /* show whiteout entries */
@ -185,7 +185,7 @@ main(int argc, char *argv[])
fts_options = FTS_PHYSICAL; fts_options = FTS_PHYSICAL;
if (getenv("LS_SAMESORT")) if (getenv("LS_SAMESORT"))
f_samesort = 1; f_samesort = 1;
while ((ch = getopt(argc, argv, while ((ch = getopt(argc, argv,
"1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) {
switch (ch) { switch (ch) {
/* /*
@ -241,7 +241,7 @@ main(int argc, char *argv[])
f_timesort = 1; f_timesort = 1;
f_sizesort = 0; f_sizesort = 0;
break; break;
/* Other flags. Please keep alphabetic. */ /* Other flags. Please keep alphabetic. */
case ',': case ',':
f_thousands = 1; f_thousands = 1;
break; break;
@ -250,10 +250,10 @@ main(int argc, char *argv[])
f_octal = 1; f_octal = 1;
f_octal_escape = 0; f_octal_escape = 0;
break; break;
case 'D': case 'D':
f_timeformat = optarg; f_timeformat = optarg;
break; break;
case 'F': case 'F':
f_type = 1; f_type = 1;
f_slash = 0; f_slash = 0;
break; break;
@ -534,7 +534,7 @@ traverse(int argc, char *argv[], int options)
/* /*
* If already output something, put out a newline as * If already output something, put out a newline as
* a separator. If multiple arguments, precede each * a separator. If multiple arguments, precede each
* directory with its name. * directory with its name.
*/ */
if (output) { if (output) {
@ -861,7 +861,7 @@ label_out:
d.s_size = sizelen; d.s_size = sizelen;
d.s_user = maxuser; d.s_user = maxuser;
} }
if (f_thousands) /* make space for commas */ if (f_thousands) /* make space for commas */
d.s_size += (d.s_size - 1) / 3; d.s_size += (d.s_size - 1) / 3;
printfcn(&d); printfcn(&d);
output = 1; output = 1;
@ -874,7 +874,7 @@ label_out:
/* /*
* Ordering for mastercmp: * Ordering for mastercmp:
* If ordering the argv (fts_level = FTS_ROOTLEVEL) return non-directories * If ordering the argv (fts_level = FTS_ROOTLEVEL) return non-directories
* as larger than directories. Within either group, use the sort function. * as larger than directories. Within either group, use the sort function.
* All other levels use the sort function. Error entries remain unsorted. * All other levels use the sort function. Error entries remain unsorted.
*/ */
static int static int

View File

@ -49,14 +49,14 @@ extern int f_longform; /* long listing format */
extern int f_octal; /* print unprintables in octal */ extern int f_octal; /* print unprintables in octal */
extern int f_octal_escape; /* like f_octal but use C escapes if possible */ extern int f_octal_escape; /* like f_octal but use C escapes if possible */
extern int f_nonprint; /* show unprintables as ? */ extern int f_nonprint; /* show unprintables as ? */
extern int f_samesort; /* sort time and name in same direction */ extern int f_samesort; /* sort time and name in same direction */
extern int f_sectime; /* print the real time for all files */ extern int f_sectime; /* print the real time for all files */
extern int f_size; /* list size in short listing */ extern int f_size; /* list size in short listing */
extern int f_slash; /* append a '/' if the file is a directory */ extern int f_slash; /* append a '/' if the file is a directory */
extern int f_sortacross; /* sort across rows, not down columns */ extern int f_sortacross; /* sort across rows, not down columns */
extern int f_statustime; /* use time of last mode change */ extern int f_statustime; /* use time of last mode change */
extern int f_thousands; /* show file sizes with thousands separators */ extern int f_thousands; /* show file sizes with thousands separators */
extern char *f_timeformat; /* user-specified time format */ extern char *f_timeformat; /* user-specified time format */
extern int f_notabs; /* don't use tab-separated multi-col output */ extern int f_notabs; /* don't use tab-separated multi-col output */
extern int f_type; /* add type character for non-regular files */ extern int f_type; /* add type character for non-regular files */
#ifdef COLORLS #ifdef COLORLS

View File

@ -160,7 +160,7 @@ printlong(const DISPLAY *dp)
strmode(sp->st_mode, buf); strmode(sp->st_mode, buf);
aclmode(buf, p); aclmode(buf, p);
np = p->fts_pointer; np = p->fts_pointer;
(void)printf("%s %*u %-*s %-*s ", buf, dp->s_nlink, (void)printf("%s %*u %-*s %-*s ", buf, dp->s_nlink,
sp->st_nlink, dp->s_user, np->user, dp->s_group, sp->st_nlink, dp->s_user, np->user, dp->s_group,
np->group); np->group);
if (f_flags) if (f_flags)
@ -382,7 +382,7 @@ printtime(time_t ftime)
format = d_first ? "%e %b %R" : "%b %e %R"; format = d_first ? "%e %b %R" : "%b %e %R";
else else
/* mmm dd yyyy || dd mmm yyyy */ /* mmm dd yyyy || dd mmm yyyy */
format = d_first ? "%e %b %Y" : "%b %e %Y"; format = d_first ? "%e %b %Y" : "%b %e %Y";
strftime(longstring, sizeof(longstring), format, localtime(&ftime)); strftime(longstring, sizeof(longstring), format, localtime(&ftime));
fputs(longstring, stdout); fputs(longstring, stdout);
fputc(' ', stdout); fputc(' ', stdout);
@ -606,11 +606,11 @@ printsize(size_t width, off_t bytes)
humanize_number(buf, sizeof(buf), (int64_t)bytes, "", humanize_number(buf, sizeof(buf), (int64_t)bytes, "",
HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
(void)printf("%*s ", (u_int)width, buf); (void)printf("%*s ", (u_int)width, buf);
} else if (f_thousands) { /* with commas */ } else if (f_thousands) { /* with commas */
/* This format assignment needed to work round gcc bug. */ /* This format assignment needed to work round gcc bug. */
const char *format = "%*j'd "; const char *format = "%*j'd ";
(void)printf(format, (u_int)width, bytes); (void)printf(format, (u_int)width, bytes);
} else } else
(void)printf("%*jd ", (u_int)width, bytes); (void)printf("%*jd ", (u_int)width, bytes);
} }

View File

@ -132,7 +132,7 @@ prn_printable(const char *s)
* to fix this as an efficient fix would involve a lookup table. Same goes * to fix this as an efficient fix would involve a lookup table. Same goes
* for the rather inelegant code in prn_octal. * for the rather inelegant code in prn_octal.
* *
* DES 1998/04/23 * DES 1998/04/23
*/ */
size_t size_t
@ -200,9 +200,9 @@ prn_octal(const char *s)
for (i = 0; i < prtlen; i++) { for (i = 0; i < prtlen; i++) {
ch = (unsigned char)s[i]; ch = (unsigned char)s[i];
putchar('\\'); putchar('\\');
putchar('0' + (ch >> 6)); putchar('0' + (ch >> 6));
putchar('0' + ((ch >> 3) & 7)); putchar('0' + ((ch >> 3) & 7));
putchar('0' + (ch & 7)); putchar('0' + (ch & 7));
len += 4; len += 4;
} }
} }