summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-20 16:18:00 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-20 16:18:00 (GMT)
commitf421ab92dcd3d8e15e14424401e18ace004fbb5e (patch)
treedd0c8bc49f4c0fae3214d03e67f7af853cec80c2 /generic
parent59cb3424c88d80880f7441393f913ee185a21357 (diff)
downloadtcl-f421ab92dcd3d8e15e14424401e18ace004fbb5e.zip
tcl-f421ab92dcd3d8e15e14424401e18ace004fbb5e.tar.gz
tcl-f421ab92dcd3d8e15e14424401e18ace004fbb5e.tar.bz2
Fix [39f6304c2e90549c209cd11a7920dc9921b9f48e|39f6304c2e] follow-up: Make Tcl_LinkVar toleranto to the empty string as well
Diffstat (limited to 'generic')
-rw-r--r--generic/tclLink.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclLink.c b/generic/tclLink.c
index 0b21997..2dc2e47 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -724,8 +724,8 @@ SetInvalidRealFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr) {
/*
* This function checks for integer representations, which are valid
* when linking with C variables, but which are invalid in other
- * contexts in Tcl. Handled are "+", "-", "0x", "0b" and "0o" (upper-
- * and lowercase). See bug [39f6304c2e].
+ * contexts in Tcl. Handled are "", "+", "-", "0x", "0b" and "0o"
+ * (upperand lowercase). See bug [39f6304c2e].
*/
int
GetInvalidIntFromObj(Tcl_Obj *objPtr,
@@ -737,7 +737,8 @@ GetInvalidIntFromObj(Tcl_Obj *objPtr,
if ((length == 1) && strchr("+-", str[0])) {
*intPtr = (str[0] == '+');
return TCL_OK;
- } else if ((length == 2) && (str[0] == '0') && strchr("xXbBoO", str[1])) {
+ } else if ((length == 0) ||
+ ((length == 2) && (str[0] == '0') && strchr("xXbBoO", str[1]))) {
*intPtr = 0;
return TCL_OK;
}