summaryrefslogtreecommitdiffstats
path: root/generic/tclStrToD.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-11-18 12:10:26 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-11-18 12:10:26 (GMT)
commit450b6f46c96b96bec44fb0bc119e3d11f3434f4a (patch)
tree5f4ccb4d3df569fcd06e804ff1b5ebd8a72505bb /generic/tclStrToD.c
parent4d9fc11c2ffbcc95218111734c64397df0dfcf63 (diff)
parentedcac92c086fa48aff50db9763afecbed00c2a37 (diff)
downloadtcl-450b6f46c96b96bec44fb0bc119e3d11f3434f4a.zip
tcl-450b6f46c96b96bec44fb0bc119e3d11f3434f4a.tar.gz
tcl-450b6f46c96b96bec44fb0bc119e3d11f3434f4a.tar.bz2
merge novem
Diffstat (limited to 'generic/tclStrToD.c')
-rw-r--r--generic/tclStrToD.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index bf24c38..3f7d626 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -389,6 +389,9 @@ static Tcl_WideUInt Nokia770Twiddle(Tcl_WideUInt w);
* - TCL_PARSE_SCAN_PREFIXES: ignore the prefixes 0b and 0o that are
* not part of the [scan] command's vocabulary. Use only in
* combination with TCL_PARSE_INTEGER_ONLY.
+ * - TCL_PARSE_BINARY_ONLY: parse only in the binary format, whether
+ * or not a prefix is present that would lead to binary parsing.
+ * Use only in combination with TCL_PARSE_INTEGER_ONLY.
* - TCL_PARSE_OCTAL_ONLY: parse only in the octal format, whether
* or not a prefix is present that would lead to octal parsing.
* Use only in combination with TCL_PARSE_INTEGER_ONLY.
@@ -619,6 +622,9 @@ TclParseNumber(
acceptPoint = p;
acceptLen = len;
if (c == 'x' || c == 'X') {
+ if (flags & (TCL_PARSE_OCTAL_ONLY|TCL_PARSE_BINARY_ONLY)) {
+ goto endgame;
+ }
state = ZERO_X;
break;
}
@@ -629,6 +635,9 @@ TclParseNumber(
goto zeroo;
}
if (c == 'b' || c == 'B') {
+ if (flags & TCL_PARSE_OCTAL_ONLY) {
+ goto endgame;
+ }
state = ZERO_B;
break;
}