From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Khamis Abuelkomboz (UUNET)" To: sourcenav@sources.redhat.com Subject: Bugfix for sorting problem in the symbol browser Date: Mon, 23 Apr 2001 03:04:00 -0000 Message-id: <3AE3FDC9.8070105@knuut.de> X-SW-Source: 2001-q2/msg00109.html 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 /snavigator/hyper/compare.c: +++ compare.c Mon Apr 23 09:46:47 2001 @@ -23,8 +23,10 @@ */ +#include #include #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; }