From: "Khamis Abuelkomboz (UUNET)" <khamis@knuut.de>
To: sourcenav@sources.redhat.com
Subject: Bugfix for sorting problem in the symbol browser
Date: Mon, 23 Apr 2001 03:04:00 -0000 [thread overview]
Message-ID: <3AE3FDC9.8070105@knuut.de> (raw)
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;
}
next reply other threads:[~2001-04-23 3:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-23 3:04 Khamis Abuelkomboz (UUNET) [this message]
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
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=3AE3FDC9.8070105@knuut.de \
--to=khamis@knuut.de \
--cc=sourcenav@sources.redhat.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).