Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0c84dae5c629e6456a150a5e01150df5d14db11f
Ticket: 218489ffffffffffffffffffffffffffffffffff
patch for lsort -dictionary: bug sorting string beginning wi
User & Date: nobody on 2000-10-26 01:01:12
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 706 Bug
    Version: 8.0.4
    SubmitDate: '1998-10-13'
    LastModified: '1998-10-13'
    Severity: SER
    Status: Released
    Submitter: admin
    ChangedBy: rjohnson
    OS: All
    OSVersion: NA
    Machine: NA
    FixedDate: '1998-10-13'
    FixedInVersion: NA
    ClosedDate: '2000-10-25'
    
    
    >> Jarle Greipsland wrote:
    >> > I believe there is a bug in the lsort function when the -dictionary
    style
    >> > comparisons are used.
    >> >
    >> > Example:
    >> > % lsort -dictionary {0k 1k 10k}
    >> > 1k 0k 10k
    >> >
    >> > As I understand the documentation for this option the correct result
    should
    >> > have been {0k 1k 10k}.  Perhaps this should be fixed in tcl8.1?
    >> >
    >> Bug is still present in 8.1a2 (same bad results on NT).
    >
    >I think the patch shown below applied to the
    >"generic/tclCmdIL.c" source file may fix the problem.
    >
    >*** tclCmdIL.c  Fri Aug  7 16:19:52 1998
    >--- tclCmdIL.c.new      Sun Aug 30 19:07:26 1998
    >***************
    >*** 2863,2873 ****
    >             */
    >  
    >            zeros = 0;
    >!           while ((*right == '0') && (*(right + 1) != '\0')) {
    >                right++;
    >                zeros--;
    >            }
    >!           while ((*left == '0') && (*(left + 1) != '\0')) {
    >                left++;
    >                zeros++;
    >            }
    >--- 2863,2873 ----
    >             */
    >  
    >            zeros = 0;
    >!           while ((*right == '0') && (isdigit(UCHAR(right[1])))) {
    >                right++;
    >                zeros--;
    >            }
    >!           while ((*left == '0') && (isdigit(UCHAR(left[1])))) {
    >                left++;
    >                zeros++;
    >            }
                            .
                            .
                            .
    !  Am I reading that correctly?  Lexicographic sorting which
    encounters any string which begins with a zero, and embeds
    non-digits, is likely to be in error?  That sounds important.
    
    What's the process, again?  Does Scriptics write you an
    acknowledgement, or is there a place under www.scriptics.com
    where faults are analyzed, or what?
    
    
    
    
  4. foundin changed to: "obsolete: 8.0.4"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to:
    patch for lsort -dictionary: bug sorting string beginning wi
    
  11. type changed to: "Bug"