From: Miguel Bolanos <mike@linuxlabs.com>
To: claudio@conectiva.com
Cc: linux-8086@vger.kernel.org
Subject: Re: [PATCH] elkscmd: fix ls reverse sort order
Date: Fri, 28 May 2004 10:31:33 -0600 [thread overview]
Message-ID: <1085761891.3063.1.camel@talena.hsol.net> (raw)
In-Reply-To: <Pine.LNX.4.58L.0405281135120.31184@damien.conectiva>
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
>
prev parent reply other threads:[~2004-05-28 16:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-28 14:39 [PATCH] elkscmd: fix ls reverse sort order claudio
2004-05-28 16:31 ` Miguel Bolanos [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1085761891.3063.1.camel@talena.hsol.net \
--to=mike@linuxlabs.com \
--cc=claudio@conectiva.com \
--cc=linux-8086@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox