summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsGR.c
diff options
context:
space:
mode:
authoraspect+tclcore@abstracted-spleen.org <aspect>2015-02-19 02:42:13 (GMT)
committeraspect+tclcore@abstracted-spleen.org <aspect>2015-02-19 02:42:13 (GMT)
commitd7c1184a4d5155afc5886af8cf2a4f2146b8640b (patch)
tree0a15cfa1e8417cc5fa66669fa9cc1d9d5f6fab88 /generic/tclCompCmdsGR.c
parent320102f3cdac04af48163e20c5ad429f7904d0ea (diff)
downloadtcl-d7c1184a4d5155afc5886af8cf2a4f2146b8640b.zip
tcl-d7c1184a4d5155afc5886af8cf2a4f2146b8640b.tar.gz
tcl-d7c1184a4d5155afc5886af8cf2a4f2146b8640b.tar.bz2
handle [lreplace l x y ...] where y<x
Diffstat (limited to 'generic/tclCompCmdsGR.c')
-rw-r--r--generic/tclCompCmdsGR.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index 5220576..e7f6473 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -1501,6 +1501,10 @@ TclCompileLreplaceCmd(
return TCL_ERROR;
}
+ if(idx2 != INDEX_END && idx2 < idx1) {
+ idx2 = idx1-1;
+ }
+
/*
* Work out what this [lreplace] is actually doing.
*/
@@ -1524,9 +1528,6 @@ TclCompileLreplaceCmd(
tmpObj = Tcl_NewIntObj(idx1);
Tcl_IncrRefCount(tmpObj);
}
- if(idx2 < idx1) {
- idx2 = idx1-1;
- }
goto dropRange;
}
}