Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5532f611db649457f6b2733c63506bc21f5bd9a0
Ticket: 465674ffffffffffffffffffffffffffffffffff
[lsort -index end-1] problem
User & Date: dkf on 2001-09-27 14:37:51
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The index 'end-1' (or with any other offset from the
    end) is processed by [lsort] exactly as if it was the
    index 'end' without an offset.  Thus
    
      % set l {{d b c} {a c b}}
      {d b c} {a c b}
      % lsort $l                 ;# OK
      {a c b} {d b c}
      % lsort -index end $l      ;# OK
      {a c b} {d b c}
      % lsort -index end-1 $l    ;# WRONG WAY ROUND!
      {a c b} {d b c}
    
    The fault is because SortCompare in tclCmdIL.c always
    sets 'index' to 'listLen - 1' when 'infoPtr->index' is
    less than -1 instead of using the value that is
    actually there (i.e. 'listLen + 1 + infoPtr->index')
    
  4. foundin changed to: "obsolete: 8.4a4"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dkf"
  9. subsystem changed to: "17. Commands I-L"
  10. title changed to: "[lsort -index end-1] problem"
  11. type changed to: "Bug"