diff options
author | hobbs <hobbs> | 1999-11-30 01:42:57 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 1999-11-30 01:42:57 (GMT) |
commit | 75a24aeeddf75c00a068fffcf2ae042aebfcb44b (patch) | |
tree | d32f04afe68f725680837e17a2ec14bb9e264656 /generic/tclScan.c | |
parent | d33e2488bcb85e9721459e8cccf43eab523cad87 (diff) | |
download | tcl-75a24aeeddf75c00a068fffcf2ae042aebfcb44b.zip tcl-75a24aeeddf75c00a068fffcf2ae042aebfcb44b.tar.gz tcl-75a24aeeddf75c00a068fffcf2ae042aebfcb44b.tar.bz2 |
* tests/scan.test:
* generic/tclScan.c: fixed scan where %[..] didn't match anything
and added test case [Bug: 3700]
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r-- | generic/tclScan.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c index 3d7b37e..bf238cf 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclScan.c,v 1.5 1999/11/19 06:34:24 hobbs Exp $ + * RCS: @(#) $Id: tclScan.c,v 1.6 1999/11/30 01:42:59 hobbs Exp $ */ #include "tclInt.h" @@ -810,6 +810,12 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv) } ReleaseCharSet(&cset); + if (string == end) { + /* + * Nothing matched the range, stop processing + */ + goto done; + } if (!(flags & SCAN_SUPPRESS)) { objPtr = Tcl_NewStringObj(string, end-string); Tcl_IncrRefCount(objPtr); |