summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixXId.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-04-19 17:29:39 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-04-19 17:29:39 (GMT)
commit460dcd4bf3f9fadbd240dfcf2831278cb264e3bf (patch)
treeb00f7f86b33280c023fbe908510435241ef9f314 /unix/tkUnixXId.c
parent7e7435a12f36a5146680ece7bff1f4f48f407944 (diff)
parentbcb71c3efaadfc55dcd742522aaf331a40b9a7ec (diff)
downloadtk-little.zip
tk-little.tar.gz
tk-little.tar.bz2
Merge 8.6.5 release.little
Diffstat (limited to 'unix/tkUnixXId.c')
-rw-r--r--unix/tkUnixXId.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c
index 819b7aa..668f228 100644
--- a/unix/tkUnixXId.c
+++ b/unix/tkUnixXId.c
@@ -125,13 +125,23 @@ TkpScanWindowId(
const char *string,
Window *idPtr)
{
- int value;
+ int code;
+ Tcl_Obj obj;
- if (Tcl_GetInt(interp, string, &value) != TCL_OK) {
- return TCL_ERROR;
+ obj.refCount = 1;
+ obj.bytes = (char *) string; /* DANGER?! */
+ obj.length = strlen(string);
+ obj.typePtr = NULL;
+
+ code = Tcl_GetLongFromObj(interp, &obj, (long *)idPtr);
+
+ if (obj.refCount > 1) {
+ Tcl_Panic("invalid sharing of Tcl_Obj on C stack");
+ }
+ if (obj.typePtr && obj.typePtr->freeIntRepProc) {
+ obj.typePtr->freeIntRepProc(&obj);
}
- *idPtr = (Window) value;
- return TCL_OK;
+ return code;
}
/*