From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miguel Bolanos Subject: Re: [PATCH] elkscmd: fix ls reverse sort order Date: Fri, 28 May 2004 10:31:33 -0600 Sender: linux-8086-owner@vger.kernel.org Message-ID: <1085761891.3063.1.camel@talena.hsol.net> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Id: Content-Type: text/plain; charset="us-ascii" To: claudio@conectiva.com Cc: linux-8086@vger.kernel.org Applied, thanks. Mike On Fri, 2004-05-28 at 08:39, claudio@conectiva.com wrote: > I fixed this once a long time ago in qsort, but I think it > was also fixed in ls making the order reversed again. > > > > diff -rud elkscmd.orig/file_utils/ls.c elkscmd/file_utils/ls.c > --- elkscmd.orig/file_utils/ls.c 2004-05-27 23:41:26.000000000 -0300 > +++ elkscmd/file_utils/ls.c 2004-05-28 08:44:03.000000000 -0300 > @@ -18,6 +18,9 @@ > * 13-Jan-2002 rhw@MemAlpha.cx (Riley Williams) > * - Reformatted source consistently. > * - Added -A option: -a excluding . and .. > + * 28-May-2004 claudio@conectiva.com (Claudio Matsuoka) > + * - Fixed sort direction, keeps qsort and strcmp consistent > + * - Removed alias to 'dir' (doesn't seem to belong here) > */ > > #if !defined(DEBUG) > @@ -71,7 +74,7 @@ > ( (c=name[1]) && (c!='.') ) || (name[2]&&c) > > > -static int cols = 0, col = 0, reverse=-1; > +static int cols = 0, col = 0, reverse = 1; > static char fmt[16] = "%s"; > > > @@ -81,7 +84,7 @@ > int namesort(a, b) > const char **a, **b; > { > - return reverse*strcmp(*a, *b); > + return reverse * strcmp(*a, *b); > } > > struct Stack > @@ -465,8 +468,6 @@ > /* > * Set relevant flags for command name > */ > - if (!strcmp(*argv,"dir")) > - flags |= LSF_LONG; > > while ( --argc && ((cp = * ++argv)[0]=='-') ) { > while (*++cp) { > > - > To unsubscribe from this list: send the line "unsubscribe linux-8086" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >