public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* Bugfix for sorting problem in the symbol browser
@ 2001-04-23  3:04 Khamis Abuelkomboz (UUNET)
  2001-04-23  3:06 ` Khamis Abuelkomboz (UUNET)
  0 siblings, 1 reply; 5+ messages in thread
From: Khamis Abuelkomboz (UUNET) @ 2001-04-23  3:04 UTC (permalink / raw)
  To: sourcenav

This patch applies to SN5.0 and SN4.52.

The whole file is located at http://home.knuut.de/sn/compare.c
Please notice that it uses the same compare conditions like the
column sorting...
You can download the binaries with this change for windows platforms:
http://home.knuut.de/sn/sn452/hyper.exe
http://home.knuut.de/sn/sn50/hyper.exe

PATCH-Output for the fixed file <SRC>/snavigator/hyper/compare.c:

+++ compare.c   Mon Apr 23 09:46:47 2001
@@ -23,8 +23,10 @@

  */

+#include <config.h>
  #include <ctype.h>
  #include "tclInt.h"
+#include "tkInt.h"

  /*
   *----------------------------------------------------------------------
@@ -79,44 +81,12 @@
      right++;
    }

-  for ( ; (*left != '\0') && (*right != '\0'); left++, right++) {
-    if (*left == *right) {
-      continue;
-    }
-
-    leftCh = toupper(*left);
-    rightCh = toupper(*right);
-
-    if (leftCh < rightCh) {
-      Tcl_SetIntObj(Tcl_GetObjResult(interp), -1);
-      return TCL_OK;
-    } else if (rightCh < leftCh) {
-      Tcl_SetIntObj(Tcl_GetObjResult(interp), 1);
-      return TCL_OK;
-    } else {
-      /* `A' is less than `a'. */
-      if (isupper(*left) && islower(*right)) {
-       Tcl_SetIntObj(Tcl_GetObjResult(interp), -1);
-       return TCL_OK;
-      }
-      /* `a' is greater than `A'. */
-      if (islower(*left) && isupper(*right)) {
-       Tcl_SetIntObj(Tcl_GetObjResult(interp), 1);
-       return TCL_OK;
-      }
-    }
-  }
-
-  if (*left == '\0') {
-    if (*right == '\0') {
-      Tcl_SetIntObj(Tcl_GetObjResult(interp), 0);
-    } else {
-      Tcl_SetIntObj(Tcl_GetObjResult(interp), -1);
+  dummy = (tolower(*left) - tolower(*right));
+  if (dummy == 0 && *left != '\0')
+    {
+      dummy = strcasecmp (left + 1, right + 1);
      }
-  } else {
-    Tcl_SetIntObj(Tcl_GetObjResult(interp), 1);
-  }
-
+  Tcl_SetIntObj(Tcl_GetObjResult(interp), dummy);
    return TCL_OK;
  }

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

end of thread, other threads:[~2001-04-26 18:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-23  3:04 Bugfix for sorting problem in the symbol browser Khamis Abuelkomboz (UUNET)
2001-04-23  3:06 ` Khamis Abuelkomboz (UUNET)
2001-04-26  5:24   ` Using Nedit, gvim, etc Editors with Snav 4.x Bill Munday
2001-04-26 16:08     ` Ian Roxborough
2001-04-26 18:36     ` Mo DeJong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).