summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2021-08-27 13:07:59 (GMT)
committerKevin Walzer <kw@codebykevin.com>2021-08-27 13:07:59 (GMT)
commit1a54044f9bb3b3a3d3128fe2037c7e24c2ad7371 (patch)
treea2884e0443833cc797fe8f72b7ee4d218c53986e
parentde0b49bb2ba6e47aaef78bdd262380568efbb255 (diff)
downloadtk-1a54044f9bb3b3a3d3128fe2037c7e24c2ad7371.zip
tk-1a54044f9bb3b3a3d3128fe2037c7e24c2ad7371.tar.gz
tk-1a54044f9bb3b3a3d3128fe2037c7e24c2ad7371.tar.bz2
Fix crash in wm test suite on Windows
-rw-r--r--win/tkWinWm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 10087f2..6a23ff3 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -4288,7 +4288,7 @@ WmIconphotoCmd(
TkWindow *useWinPtr = winPtr; /* window to apply to (NULL if -default) */
Tk_PhotoHandle photo;
Tk_PhotoImageBlock block;
- int i, width, height, startObj = 3;
+ int i, width, height, startObj = 3, isDefault = 0;
BlockOfIconImagesPtr lpIR;
WinIconPtr titlebaricon = NULL;
HICON hIcon;
@@ -4310,6 +4310,15 @@ WmIconphotoCmd(
"window ?-default? image1 ?image2 ...?");
return TCL_ERROR;
}
+
+ if (strcmp(Tcl_GetString(objv[3]), "-default") == 0) {
+ isDefault = 1;
+ if (objc == 4) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?-default? image1 ?image2 ...?");
+ return TCL_ERROR;
+ }
+ }
/*
* Get icon name. We only use the first icon name.