summaryrefslogtreecommitdiffstats
path: root/generic/tclLink.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-20 16:21:43 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-20 16:21:43 (GMT)
commitc26df8ae12952ac4cbe9be469b02ff5a5ffb2eea (patch)
treeeb130f1db742ecef22944557e956f3b4879ea0bb /generic/tclLink.c
parent47692f4e993ebdf8b38b463fe52f56bcb6e4b922 (diff)
parentd1c1cbf476c6f0cc9596b6777a2fc5151be01cab (diff)
downloadtcl-c26df8ae12952ac4cbe9be469b02ff5a5ffb2eea.zip
tcl-c26df8ae12952ac4cbe9be469b02ff5a5ffb2eea.tar.gz
tcl-c26df8ae12952ac4cbe9be469b02ff5a5ffb2eea.tar.bz2
Fix [39f6304c2e90549c209cd11a7920dc9921b9f48e|39f6304c2e] follow-up: Make Tcl_LinkVar toleranto to the empty string as well
Diffstat (limited to 'generic/tclLink.c')
-rw-r--r--generic/tclLink.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclLink.c b/generic/tclLink.c
index d6d709f..2ead6df 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -722,8 +722,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,
@@ -735,7 +735,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;
}