summaryrefslogtreecommitdiffstats
path: root/generic/tkWindow.c
diff options
context:
space:
mode:
authorpspjuth <peter.spjuth@gmail.com>2006-04-11 21:52:19 (GMT)
committerpspjuth <peter.spjuth@gmail.com>2006-04-11 21:52:19 (GMT)
commit29f17227ad41d506327d16125bd288af8e7d38cd (patch)
tree3052dd689117347f460963efea084f5647e70b26 /generic/tkWindow.c
parentd7c24d9020572692a1c4520de8704f8fe761a556 (diff)
downloadtk-29f17227ad41d506327d16125bd288af8e7d38cd.zip
tk-29f17227ad41d506327d16125bd288af8e7d38cd.tar.gz
tk-29f17227ad41d506327d16125bd288af8e7d38cd.tar.bz2
* generic/tkWindow.c (Tk_NameToWindow): Allow NULL interp to
Tk_NameToWindow. This fixes TkGetWindowFromObj which promises to handle NULL but didn't. * generic/tkGrid.c: Fixed handling of out of bounds row or column. * tests/grid.test: [Bug 1432666]
Diffstat (limited to 'generic/tkWindow.c')
-rw-r--r--generic/tkWindow.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index d61e1ec..ad42c6f 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWindow.c,v 1.72 2006/04/05 21:00:00 hobbs Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.73 2006/04/11 21:52:20 pspjuth Exp $
*/
#include "tkPort.h"
@@ -2259,7 +2259,8 @@ Tk_SetClassProcs(tkwin, procs, instanceData)
* Results:
* The return result is either a token for the window corresponding to
* "name", or else NULL to indicate that there is no such window. In this
- * case, an error message is left in the interp's result.
+ * case, an error message is left in the interp's result, unless interp
+ * is NULL.
*
* Side effects:
* None.
@@ -2282,15 +2283,19 @@ Tk_NameToWindow(interp, pathName, tkwin)
* we're on our way out of the application.
*/
- Tcl_AppendResult(interp, "NULL main window", NULL);
+ if (interp != NULL) {
+ Tcl_AppendResult(interp, "NULL main window", NULL);
+ }
return NULL;
}
hPtr = Tcl_FindHashEntry(&((TkWindow *) tkwin)->mainPtr->nameTable,
pathName);
if (hPtr == NULL) {
- Tcl_AppendResult(interp, "bad window path name \"",
- pathName, "\"", NULL);
+ if (interp != NULL) {
+ Tcl_AppendResult(interp, "bad window path name \"",
+ pathName, "\"", NULL);
+ }
return NULL;
}
return (Tk_Window) Tcl_GetHashValue(hPtr);