public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] elkscmd: fix ls reverse sort order
@ 2004-05-28 14:39 claudio
  2004-05-28 16:31 ` Miguel Bolanos
  0 siblings, 1 reply; 2+ messages in thread
From: claudio @ 2004-05-28 14:39 UTC (permalink / raw)
  To: linux-8086


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) {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-28 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-28 14:39 [PATCH] elkscmd: fix ls reverse sort order claudio
2004-05-28 16:31 ` Miguel Bolanos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox