summaryrefslogtreecommitdiffstats
path: root/tk8.6
diff options
context:
space:
mode:
Diffstat (limited to 'tk8.6')
-rw-r--r--tk8.6/macosx/tkMacOSXWm.c4
-rw-r--r--tk8.6/macosx/tkMacOSXWm.h5
2 files changed, 6 insertions, 3 deletions
diff --git a/tk8.6/macosx/tkMacOSXWm.c b/tk8.6/macosx/tkMacOSXWm.c
index 39990e6..ac5f43d 100644
--- a/tk8.6/macosx/tkMacOSXWm.c
+++ b/tk8.6/macosx/tkMacOSXWm.c
@@ -2899,11 +2899,13 @@ WmProtocolCmd(
}
cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
if (cmdLength > 0) {
- protPtr = ckalloc(HANDLER_SIZE(cmdLength));
+ /* protPtr = ckalloc(HANDLER_SIZE(cmdLength));*/
+ protPtr = ckalloc(sizeof(ProtocolHandler));
protPtr->protocol = protocol;
protPtr->nextPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr;
protPtr->interp = interp;
+ protPtr->command = malloc(cmdLength+1);
strcpy(protPtr->command, cmd);
}
return TCL_OK;
diff --git a/tk8.6/macosx/tkMacOSXWm.h b/tk8.6/macosx/tkMacOSXWm.h
index d98010f..b504896 100644
--- a/tk8.6/macosx/tkMacOSXWm.h
+++ b/tk8.6/macosx/tkMacOSXWm.h
@@ -29,7 +29,8 @@ typedef struct ProtocolHandler {
* same top-level window, or NULL for end of
* list. */
Tcl_Interp *interp; /* Interpreter in which to invoke command. */
- char command[4]; /* Tcl command to invoke when a client message
+ /* char command[4]; Tcl command to invoke when a client message*/
+ char* command; /* Tcl command to invoke when a client message
* for this protocol arrives. The actual size
* of the structure varies to accommodate the
* needs of the actual command. THIS MUST BE
@@ -37,7 +38,7 @@ typedef struct ProtocolHandler {
} ProtocolHandler;
#define HANDLER_SIZE(cmdLength) \
-((unsigned) (sizeof(ProtocolHandler) - 3 + cmdLength))
+ ((unsigned) (sizeof(ProtocolHandler) -3 + cmdLength))
/*
* A data structure of the following type holds window-manager-related