Date: Tue, 11 Dec 2012 15:35:25 +0200 From: Jaakko Heinonen <jh@FreeBSD.org> To: Greg Lehey <grog@FreeBSD.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r244075 - stable/9/bin/ls Message-ID: <20121211133525.GA43682@jh> In-Reply-To: <201212100311.qBA3BKL6004047@svn.freebsd.org> References: <201212100311.qBA3BKL6004047@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121211133525.GA43682>