summaryrefslogtreecommitdiffstats
path: root/generic/tclScan.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-12-19 19:03:16 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-12-19 19:03:16 (GMT)
commitdaebf10e2ccb834224974521717da8f39bc873d1 (patch)
tree0a12925e93451c4a8954efb8eae7c1f973c9a1ff /generic/tclScan.c
parentb2d1f7871ac602e36507ea0beab5868e1af45733 (diff)
downloadtcl-daebf10e2ccb834224974521717da8f39bc873d1.zip
tcl-daebf10e2ccb834224974521717da8f39bc873d1.tar.gz
tcl-daebf10e2ccb834224974521717da8f39bc873d1.tar.bz2
2005-12-19 Don Porter <dgp@users.sourceforge.net>
* generic/tclCmdMZ.c: Modified [string is double] to use * tests/string.test: TclParseNumber() to parse trailing whitespace. Ensures consistency, and makes it easier to cleanup after invalid internal reps left behind by parsing [Bugs 1360432 1382287]. * generic/tclParseExpr.c: Added TCL_PARSE_NO_WHITESPACE to * generic/tclScan.c: TclParseNumber() calls since [scan] and * tests/scan.test: [expr] parsing don't want spaces in parsed numbers. * generic/tclInt.h: Added TCL_PARSE_NO_WHITESPACE flag to the * generic/tclStrToD.c: TclParseNumber() interface.
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r--generic/tclScan.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 268353c..91909c8 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.22 2005/11/12 04:08:05 dgp Exp $
+ * RCS: @(#) $Id: tclScan.c,v 1.23 2005/12/19 19:03:17 dgp Exp $
*/
#include "tclInt.h"
@@ -630,7 +630,7 @@ Tcl_ScanObjCmd(
objIndex = 0;
nconversions = 0;
while (*format != '\0') {
- int parseFlag = 0;
+ int parseFlag = TCL_PARSE_NO_WHITESPACE;
format += Tcl_UtfToUniChar(format, &ch);
flags = 0;
@@ -735,19 +735,19 @@ Tcl_ScanObjCmd(
case 'd':
op = 'i';
- parseFlag = TCL_PARSE_DECIMAL_ONLY;
+ parseFlag |= TCL_PARSE_DECIMAL_ONLY;
break;
case 'i':
op = 'i';
- parseFlag = TCL_PARSE_SCAN_PREFIXES;
+ parseFlag |= TCL_PARSE_SCAN_PREFIXES;
break;
case 'o':
op = 'i';
- parseFlag = TCL_PARSE_OCTAL_ONLY | TCL_PARSE_SCAN_PREFIXES;
+ parseFlag |= TCL_PARSE_OCTAL_ONLY | TCL_PARSE_SCAN_PREFIXES;
break;
case 'x':
op = 'i';
- parseFlag = TCL_PARSE_HEXADECIMAL_ONLY;
+ parseFlag |= TCL_PARSE_HEXADECIMAL_ONLY;
break;
case 'u':
op = 'i';
@@ -955,7 +955,7 @@ Tcl_ScanObjCmd(
width = ~0;
}
if (TCL_OK != TclParseNumber(NULL, objPtr, NULL, string, width,
- &end, TCL_PARSE_DECIMAL_ONLY)) {
+ &end, TCL_PARSE_DECIMAL_ONLY | TCL_PARSE_NO_WHITESPACE)) {
Tcl_DecrRefCount(objPtr);
if (width < 0) {
if (*end == '\0') {