diff options
author | Kevin Walzer <kw@codebykevin.com> | 2014-08-01 01:00:11 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2014-08-01 01:00:11 (GMT) |
commit | 641b317cbd760a8d3676fff03a903c8c294410d0 (patch) | |
tree | 9ab24e36b52733a61c3f120b28ddf61cb46dddaf /generic | |
parent | 17e61e6ace9cd71343e3e2d6be7914740fea3d6d (diff) | |
download | tk-641b317cbd760a8d3676fff03a903c8c294410d0.zip tk-641b317cbd760a8d3676fff03a903c8c294410d0.tar.gz tk-641b317cbd760a8d3676fff03a903c8c294410d0.tar.bz2 |
Fix for font configure crash on OS X, thanks to rob@bitkeeper.com for the patch
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkFont.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c index cbc4cf4..a955c35 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -600,40 +600,40 @@ Tk_FontObjCmd( return result; } case FONT_CONFIGURE: { - int result; - const char *string; - Tcl_Obj *objPtr; - NamedFont *nfPtr; - Tcl_HashEntry *namedHashPtr; - - if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "fontname ?-option value ...?"); - return TCL_ERROR; - } - string = Tcl_GetString(objv[2]); - namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, string); + int result; + const char *string; + Tcl_Obj *objPtr; + NamedFont *nfPtr; + Tcl_HashEntry *namedHashPtr; + + if (objc < 3) { + Tcl_WrongNumArgs(interp, 2, objv, "fontname ?-option value ...?"); + return TCL_ERROR; + } + string = Tcl_GetString(objv[2]); + namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, string); nfPtr = NULL; /* lint. */ - if (namedHashPtr != NULL) { - nfPtr = Tcl_GetHashValue(namedHashPtr); - } - if ((namedHashPtr == NULL) || nfPtr->deletePending) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "named font \"%s\" doesn't exist", string)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "FONT", string, NULL); - return TCL_ERROR; - } - if (objc == 3) { - objPtr = NULL; - } else if (objc == 4) { - objPtr = objv[3]; - } else { - result = ConfigAttributesObj(interp, tkwin, objc - 3, objv + 3, - &nfPtr->fa); - UpdateDependentFonts(fiPtr, tkwin, namedHashPtr); - return result; - } - return GetAttributeInfoObj(interp, &nfPtr->fa, objPtr); - } + if (namedHashPtr != NULL) { + nfPtr = Tcl_GetHashValue(namedHashPtr); + } + if ((namedHashPtr == NULL) || nfPtr->deletePending) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "named font \"%s\" doesn't exist", string)); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "FONT", string, NULL); + return TCL_ERROR; + } + if (objc == 3) { + objPtr = NULL; + } else if (objc == 4) { + objPtr = objv[3]; + } else { + result = ConfigAttributesObj(interp, tkwin, objc - 3, objv + 3, + &nfPtr->fa); + UpdateDependentFonts(fiPtr, tkwin, namedHashPtr); + return result; + } + return GetAttributeInfoObj(interp, &nfPtr->fa, objPtr); + } case FONT_CREATE: { int skip = 3, i; const char *name; |