mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-29 12:44:53 +01:00
Fix some style bugs I introduced pointed out by bde. Also add a blank
line after the empty variable declarations. Reviewed by: md5
This commit is contained in:
parent
887f7ef50a
commit
f137c9c100
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130967
38
bin/ls/cmp.c
38
bin/ls/cmp.c
@ -51,83 +51,91 @@ __FBSDID("$FreeBSD$");
|
||||
int
|
||||
namecmp(const FTSENT *a, const FTSENT *b)
|
||||
{
|
||||
|
||||
return (strcoll(a->fts_name, b->fts_name));
|
||||
}
|
||||
|
||||
int
|
||||
revnamecmp(const FTSENT *a, const FTSENT *b)
|
||||
{
|
||||
|
||||
return (strcoll(b->fts_name, a->fts_name));
|
||||
}
|
||||
|
||||
int
|
||||
modcmp(const FTSENT *a, const FTSENT *b)
|
||||
{
|
||||
|
||||
if (b->fts_statp->st_mtimespec.tv_sec >
|
||||
a->fts_statp->st_mtimespec.tv_sec)
|
||||
return 1;
|
||||
return (1);
|
||||
if (b->fts_statp->st_mtimespec.tv_sec <
|
||||
a->fts_statp->st_mtimespec.tv_sec)
|
||||
return -1;
|
||||
return (-1);
|
||||
if (b->fts_statp->st_mtimespec.tv_nsec >
|
||||
a->fts_statp->st_mtimespec.tv_nsec)
|
||||
return 1;
|
||||
return (1);
|
||||
if (b->fts_statp->st_mtimespec.tv_nsec <
|
||||
a->fts_statp->st_mtimespec.tv_nsec)
|
||||
return -1;
|
||||
return (-1);
|
||||
return (strcoll(a->fts_name, b->fts_name));
|
||||
}
|
||||
|
||||
int
|
||||
revmodcmp(const FTSENT *a, const FTSENT *b)
|
||||
{
|
||||
return (modcmp(b,a));
|
||||
|
||||
return (modcmp(b, a));
|
||||
}
|
||||
|
||||
int
|
||||
acccmp(const FTSENT *a, const FTSENT *b)
|
||||
{
|
||||
|
||||
if (b->fts_statp->st_atimespec.tv_sec >
|
||||
a->fts_statp->st_atimespec.tv_sec)
|
||||
return 1;
|
||||
return (1);
|
||||
if (b->fts_statp->st_atimespec.tv_sec <
|
||||
a->fts_statp->st_atimespec.tv_sec)
|
||||
return -1;
|
||||
return (-1);
|
||||
if (b->fts_statp->st_atimespec.tv_nsec >
|
||||
a->fts_statp->st_atimespec.tv_nsec)
|
||||
return 1;
|
||||
return (1);
|
||||
if (b->fts_statp->st_atimespec.tv_nsec <
|
||||
a->fts_statp->st_atimespec.tv_nsec)
|
||||
return -1;
|
||||
return (-1);
|
||||
return (strcoll(a->fts_name, b->fts_name));
|
||||
}
|
||||
|
||||
int
|
||||
revacccmp(const FTSENT *a, const FTSENT *b)
|
||||
{
|
||||
return (acccmp(b,a));
|
||||
|
||||
return (acccmp(b, a));
|
||||
}
|
||||
|
||||
int
|
||||
statcmp(const FTSENT *a, const FTSENT *b)
|
||||
{
|
||||
|
||||
if (b->fts_statp->st_ctimespec.tv_sec >
|
||||
a->fts_statp->st_ctimespec.tv_sec)
|
||||
return 1;
|
||||
return (1);
|
||||
if (b->fts_statp->st_ctimespec.tv_sec <
|
||||
a->fts_statp->st_ctimespec.tv_sec)
|
||||
return -1;
|
||||
return (-1);
|
||||
if (b->fts_statp->st_ctimespec.tv_nsec >
|
||||
a->fts_statp->st_ctimespec.tv_nsec)
|
||||
return 1;
|
||||
return (1);
|
||||
if (b->fts_statp->st_ctimespec.tv_nsec <
|
||||
a->fts_statp->st_ctimespec.tv_nsec)
|
||||
return -1;
|
||||
return (-1);
|
||||
return (strcoll(a->fts_name, b->fts_name));
|
||||
}
|
||||
|
||||
int
|
||||
revstatcmp(const FTSENT *a, const FTSENT *b)
|
||||
{
|
||||
return (statcmp(b,a));
|
||||
|
||||
return (statcmp(b, a));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user