summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>1999-11-30 01:42:57 (GMT)
committerhobbs <hobbs@noemail.net>1999-11-30 01:42:57 (GMT)
commit154f668926a3c040d6e463219a615830a14d9654 (patch)
treed32f04afe68f725680837e17a2ec14bb9e264656 /generic
parent4b317b2b26557ed368ddc34b1b3bd955700e1418 (diff)
downloadtcl-154f668926a3c040d6e463219a615830a14d9654.zip
tcl-154f668926a3c040d6e463219a615830a14d9654.tar.gz
tcl-154f668926a3c040d6e463219a615830a14d9654.tar.bz2
* tests/scan.test:
* generic/tclScan.c: fixed scan where %[..] didn't match anything and added test case [Bug: 3700] FossilOrigin-Name: 27ebd6ad86e7098995c815fc6832a0517ddfc46b
Diffstat (limited to 'generic')
-rw-r--r--generic/tclScan.c8
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);