diff options
author | andreask <andreask> | 2012-05-17 21:47:55 (GMT) |
---|---|---|
committer | andreask <andreask> | 2012-05-17 21:47:55 (GMT) |
commit | 4ebcb961515b7669f17d14bfe72d4eebd98f724f (patch) | |
tree | 1d1e5aff3b84beae7a1a01f1002b973777f8cd06 /generic/tclCmdMZ.c | |
parent | a3a3198dfe08f980f9895d03c2a31a6c302c21dc (diff) | |
parent | 6e977b903ee0e35f5b799abe1c8b3c902a5b5cef (diff) | |
download | tcl-4ebcb961515b7669f17d14bfe72d4eebd98f724f.zip tcl-4ebcb961515b7669f17d14bfe72d4eebd98f724f.tar.gz tcl-4ebcb961515b7669f17d14bfe72d4eebd98f724f.tar.bz2 |
Brought bugfix branch uptodate with head development.
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index c5bb72d..7e94d9f 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -3758,8 +3758,12 @@ TclNRSwitchObjCmd( if (indexVarObj != NULL) { Tcl_Obj *rangeObjAry[2]; - rangeObjAry[0] = Tcl_NewLongObj(info.matches[j].start); - rangeObjAry[1] = Tcl_NewLongObj(info.matches[j].end); + if (info.matches[j].end > 0) { + rangeObjAry[0] = Tcl_NewLongObj(info.matches[j].start); + rangeObjAry[1] = Tcl_NewLongObj(info.matches[j].end-1); + } else { + rangeObjAry[0] = rangeObjAry[1] = Tcl_NewIntObj(-1); + } /* * Never fails; the object is always clean at this point. |