svn commit: r244075 - stable/9/bin/ls
Jaakko Heinonen
jh at FreeBSD.org
Tue Dec 11 13:35:40 UTC 2012
On 2012-12-10, Greg Lehey wrote:
> MFC to r242840:
I found confusing that this commit merges changes not mentioned in the
commit message below. It make me while to notice "to" before the
revision number. Also the commit didn't record mergeinfo.
> Add y flag and environment variable LS_SAMESORT to specify the same
> sorting order for time and name with the -t option. IEEE Std 1003.2
> (POSIX.2) mandates that the -t option sort in descending order, and
> that if two files have the same timestamp, they should be sorted in
> ascending order of their names. The -r flag reverses both of these
> sort orders, so they're never the same. This creates significant
> problems for sequentially named files stored on FAT file systems,
> where it can be impossible to list them in the order in which they
> were created.
>
> Add , (comma) option to print file sizes grouped and separated by
> thousands using the non-monetary separator returned by localeconv(3),
> typically a comma or period.
> Modified: stable/9/bin/ls/cmp.c
> ==============================================================================
> --- stable/9/bin/ls/cmp.c Mon Dec 10 02:44:47 2012 (r244074)
> +++ stable/9/bin/ls/cmp.c Mon Dec 10 03:11:19 2012 (r244075)
> @@ -78,6 +78,9 @@ modcmp(const FTSENT *a, const FTSENT *b)
> if (b->fts_statp->st_mtim.tv_nsec <
> a->fts_statp->st_mtim.tv_nsec)
> return (-1);
> + if (f_samesort)
> + return (strcoll(b->fts_name, a->fts_name));
> + else
> return (strcoll(a->fts_name, b->fts_name));
> }
Wrong indentation. Merge error?
> @@ -104,6 +107,9 @@ acccmp(const FTSENT *a, const FTSENT *b)
> if (b->fts_statp->st_atim.tv_nsec <
> a->fts_statp->st_atim.tv_nsec)
> return (-1);
> + if (f_samesort)
> + return (strcoll(b->fts_name, a->fts_name));
> + else
> return (strcoll(a->fts_name, b->fts_name));
> }
Ditto.
> @@ -130,6 +136,9 @@ birthcmp(const FTSENT *a, const FTSENT *
> if (b->fts_statp->st_birthtim.tv_nsec <
> a->fts_statp->st_birthtim.tv_nsec)
> return (-1);
> + if (f_samesort)
> + return (strcoll(b->fts_name, a->fts_name));
> + else
> return (strcoll(a->fts_name, b->fts_name));
> }
Ditto.
> @@ -156,6 +165,9 @@ statcmp(const FTSENT *a, const FTSENT *b
> if (b->fts_statp->st_ctim.tv_nsec <
> a->fts_statp->st_ctim.tv_nsec)
> return (-1);
> + if (f_samesort)
> + return (strcoll(b->fts_name, a->fts_name));
> + else
> return (strcoll(a->fts_name, b->fts_name));
> }
Ditto.
--
Jaakko
More information about the svn-src-stable-9
mailing list