Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2b6fccb1a7bfeb65b051c8a1c88230631a28ebd2
Ticket: 219119ffffffffffffffffffffffffffffffffff
some order of options to lsort results in strange error
User & Date: nobody on 2000-10-26 01:11:03
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 6212 Bug
    Version: 8.4a1
    SubmitDate: '2000-09-05'
    LastModified: '2000-09-17'
    Severity: LOW
    Status: Released
    Submitter: techsupp
    ChangedBy: ericm
    OS: All
    FixedDate: '2000-09-17'
    FixedInVersion: 8.4a2
    ClosedDate: '2000-10-25'
    
    
    Name:
    Harald Kirsch
    
    ReproducibleScript:
    # run this script.
    
    proc cmplen {a b} {
      return [expr {[string length $a] - [string length $b]}]
    }
    
    set S {
      {xxx "sdafkj "}
      {yyy "sf"}
    }
    
    puts [lsort -index 1 -command cmplen -decreasing $S]
    puts ---------
    puts [lsort -command cmplen -decreasing -index 1 $S]
    
    ObservedBehavior:
    Both lsort commands should work, but only the first one does. The 2nd gives the error
    
    invalid command name "1"
        while executing
    "1 {sdafkj } sf"
        (-compare command)
        invoked from within
    "lsort -command cmplen -decreasing -index 1 $S"
        invoked from within
    "puts [lsort -command cmplen -decreasing -index 1 $S]
    
    DesiredBehavior:
    No error should occur.
    
    
    
    Patch from Kuchler (needs tests as well):
    
    The following change to the current CVS 8.4 sources will
    fix the problem.  For those working off of an older version,
    simpley remove the 'cmdPtr = objv[i+1];' line from
    tclCmdIL.c in the function Tcl_LsortObjCmd in the handling
    for the '-index' flag in the argument processing for loop.
    
    diff -c -r1.27 tclCmdIL.c
    *** tclCmdIL.c  2000/05/27 23:58:01     1.27
    --- tclCmdIL.c  2000/09/05 08:07:06
    ***************
    *** 2759,2765 ****
                            != TCL_OK) {
                        return TCL_ERROR;
                    }
    -               cmdPtr = objv[i+1];
                    i++;
                    break;
                case 6:                     /* -integer */
    --- 2759,2764 ----
    
    -- 09/05/2000 hobbs
    
    I applied this patch and added test cases for it.  The fix will be included in Tcl 8.4a2.  Nice work, everybody.
    
       Eric Melski                            The Other Tcl Guy
       ericm at ajubasolutions.com            Ajuba Solutions
    
    -- 09/17/2000 ericm
    
    
    
  4. foundin changed to: "obsolete: 8.4a1"
  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: "81. Bundled Packages"
  10. title changed to:
    some order of options to lsort results in strange error
    
  11. type changed to: "Bug"