summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-03-28 02:30:06 (GMT)
committerhobbs <hobbs>2001-03-28 02:30:06 (GMT)
commita21bda19f3e66a10cf4a9510060918de0d7db654 (patch)
treed0cf4f3c6c121b36006d123c75d742fb2b67bb7a /generic
parent7a503d88f6b5e708dd90ded74fef1f3bcdcae67f (diff)
downloadtcl-a21bda19f3e66a10cf4a9510060918de0d7db654.zip
tcl-a21bda19f3e66a10cf4a9510060918de0d7db654.tar.gz
tcl-a21bda19f3e66a10cf4a9510060918de0d7db654.tar.bz2
* tests/regexp.test (regexp-19.1):
* generic/tclCmdMZ.c (Tcl_RegsubObjCmd): fixed handling of nulls in subspec value.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdMZ.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index a0e0489..473a408 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.32 2001/03/13 11:10:44 dkf Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.33 2001/03/28 02:30:06 hobbs Exp $
*/
#include "tclInt.h"
@@ -481,7 +481,7 @@ Tcl_RegsubObjCmd(dummy, interp, objc, objv)
Tcl_RegExp regExpr;
Tcl_RegExpInfo info;
Tcl_Obj *resultPtr, *varPtr, *objPtr;
- Tcl_UniChar ch, *wsrc, *wfirstChar, *wstring, *wsubspec;
+ Tcl_UniChar ch, *wsrc, *wfirstChar, *wstring, *wsubspec, *wend;
static char *options[] = {
"-all", "-nocase", "-expanded",
@@ -629,7 +629,8 @@ Tcl_RegsubObjCmd(dummy, interp, objc, objv)
*/
wsrc = wfirstChar = wsubspec;
- for (ch = *wsrc; ch != '\0'; wsrc++, ch = *wsrc) {
+ wend = wsubspec + wsublen;
+ for (ch = *wsrc; wsrc != wend; wsrc++, ch = *wsrc) {
if (ch == '&') {
idx = 0;
} else if (ch == '\\') {