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
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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 - foundin changed to: "obsolete: 8.4a1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "81. Bundled Packages"
- title changed to:
some order of options to lsort results in strange error
- type changed to: "Bug"