summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-06-12 08:07:37 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-06-12 08:07:37 (GMT)
commit618765e259dedad64023f5f750afe080cb50e1c4 (patch)
treed0d7eaa0cc57a266b613765f972ca573df84eade /generic/tclCmdMZ.c
parent4f211efb0420a08b1bde5ecf7512c41ffbaac25a (diff)
downloadtcl-618765e259dedad64023f5f750afe080cb50e1c4.zip
tcl-618765e259dedad64023f5f750afe080cb50e1c4.tar.gz
tcl-618765e259dedad64023f5f750afe080cb50e1c4.tar.bz2
Fix for bug #219232 (submatch errors with regexp -all -inline -indices)
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 602fca4..5984ed0 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.38 2001/05/17 02:11:32 hobbs Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.39 2001/06/12 08:07:37 dkf Exp $
*/
#include "tclInt.h"
@@ -368,7 +368,11 @@ Tcl_RegexpObjCmd(dummy, interp, objc, objv)
int start, end;
Tcl_Obj *objs[2];
- if (i <= info.nsubs) {
+ /*
+ * Only adjust the match area if there was a match for
+ * that area. (Scriptics Bug 4391/SF Bug #219232)
+ */
+ if (i <= info.nsubs && info.matches[i].start >= 0) {
start = offset + info.matches[i].start;
end = offset + info.matches[i].end;