summaryrefslogtreecommitdiffstats
path: root/generic/tclParseExpr.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-07-22 10:04:16 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-07-22 10:04:16 (GMT)
commit27070d54f1091210791f5ec8bd0c2474b5531f6d (patch)
tree62adfb7d97aee2eeba07efd96276ecdbc71c51fd /generic/tclParseExpr.c
parent6a00bb0ff05f01579f3976bc1ea44902d455f9d7 (diff)
downloadtcl-27070d54f1091210791f5ec8bd0c2474b5531f6d.zip
tcl-27070d54f1091210791f5ec8bd0c2474b5531f6d.tar.gz
tcl-27070d54f1091210791f5ec8bd0c2474b5531f6d.tar.bz2
Allowed parser to recognise 'Inf' as a floating-point number. [Bug 218000]
Also produce better error messages when this happens.
Diffstat (limited to 'generic/tclParseExpr.c')
-rw-r--r--generic/tclParseExpr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/generic/tclParseExpr.c b/generic/tclParseExpr.c
index 6d1fc30..1c6a5f5 100644
--- a/generic/tclParseExpr.c
+++ b/generic/tclParseExpr.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclParseExpr.c,v 1.13 2002/06/21 21:17:39 jenglish Exp $
+ * RCS: @(#) $Id: tclParseExpr.c,v 1.14 2002/07/22 10:04:17 dkf Exp $
*/
#include "tclInt.h"
@@ -1628,7 +1628,8 @@ GetLexeme(infoPtr)
return TCL_OK;
}
} else if (startsWithDigit || (c == '.')
- || (c == 'n') || (c == 'N')) {
+ || (c == 'i') || (c == 'I') /* Could be 'Inf' */
+ || (c == 'n') || (c == 'N')) { /* Could be 'NaN' */
errno = 0;
doubleValue = strtod(src, &termPtr);
if (termPtr != src) {