diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | generic/tkEntry.c | 8 |
2 files changed, 9 insertions, 3 deletions
@@ -1,5 +1,9 @@ 2011-06-10 Don Porter <dgp@users.sourceforge.net> + * generic/tkEntry.c: [Bug 3315731] Fix [$entry -invcmd]. + +2011-06-10 Don Porter <dgp@users.sourceforge.net> + * README: Correct some README bitrot. * macosx/README: diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 64bbaad..f32a03b 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -3269,17 +3269,19 @@ EntryValidateChange( if (varValidate) { entryPtr->validate = VALIDATE_NONE; } else if (entryPtr->invalidCmd != NULL) { + int result; + Tcl_DStringInit(&script); ExpandPercents(entryPtr, entryPtr->invalidCmd, change, newValue, index, type, &script); Tcl_DStringAppend(&script, "", 1); p = Tcl_DStringValue(&script); - code = Tcl_EvalEx(entryPtr->interp, p, -1, + result = Tcl_EvalEx(entryPtr->interp, p, -1, TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT); - if (code != TCL_OK) { + if (result != TCL_OK) { Tcl_AddErrorInfo(entryPtr->interp, "\n\t(in invalidcommand executed by entry)"); - Tcl_BackgroundException(entryPtr->interp, code); + Tcl_BackgroundException(entryPtr->interp, result); code = TCL_ERROR; entryPtr->validate = VALIDATE_NONE; } |