Tcl Source Code

View Ticket
Login
Ticket UUID: a4cb3f06c4fe45aa16c8b12206da3e0d4e67ae27
Title: Using end-n as second index on lreplace broken in 8.6.4
Type: Bug Version: 8.6.4
Submitter: sbron Created on: 2015-06-15 19:58:46
Subsystem: 17. Commands I-L Assigned To: dgp
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2015-06-18 17:34:38
Resolution: Fixed Closed By: dgp
    Closed on: 2015-06-18 17:34:38
Description:
Using end-n as second index for the lreplace command has been broken by 32b6159246574b9480f8.

Example: [lreplace {0 1 2 3 4} 0 end-2] produces: 0 1 2 3 4. Should have been: 3 4
User Comments: dgp added on 2015-06-18 17:34:38:
Patch merged to trunk.

anonymous (claiming to be aspect) added on 2015-06-16 03:37:06:
The attached *-2.bundle replaces the previous bundle, and adds:

* more tests, trying to get better edge case coverage for future
* a minor documentation tweak

The tests should be reviewed to ensure I'm testing (a) for correct behaviour
and (b) appropriate cases that mishandled indexing could be prone to fail on.

anonymous (claiming to be aspect) added on 2015-06-16 00:47:35:

Oops - error was indeed introduced in [32b615924].

The attached fossil bundle adds the reported case as a test and fixes it.

Corner cases involving end-1, end etc should be exercised more carefully to ensure I haven't missed any other bugs!


Attachments: