summaryrefslogtreecommitdiffstats
path: root/generic/tkBind.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2010-05-31 17:22:45 (GMT)
committerjenglish <jenglish@flightlab.com>2010-05-31 17:22:45 (GMT)
commitd4f6bf9607a4aa2a4d5b1493f34c9ced59547708 (patch)
tree59bd9e3610b6fe5043cd2906dba04f62551e9fa5 /generic/tkBind.c
parent21254079488f4212f41c0c2b3acbe29e44bcae3d (diff)
downloadtk-d4f6bf9607a4aa2a4d5b1493f34c9ced59547708.zip
tk-d4f6bf9607a4aa2a4d5b1493f34c9ced59547708.tar.gz
tk-d4f6bf9607a4aa2a4d5b1493f34c9ced59547708.tar.bz2
Tk_CreateBinding: Silently ignore empty binding scripts (Fixes [Bug 3006842]).
ttkTreeview.c: [$tv tag bind $tag <...> {}] now removes binding.
Diffstat (limited to 'generic/tkBind.c')
-rw-r--r--generic/tkBind.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index ccffd9b..9bc987f 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.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: tkBind.c,v 1.45.2.3 2010/01/29 12:41:11 nijtmans Exp $
+ * RCS: @(#) $Id: tkBind.c,v 1.45.2.4 2010/05/31 17:22:48 jenglish Exp $
*/
#include "tkInt.h"
@@ -962,6 +962,10 @@ Tk_CreateBinding(
unsigned long eventMask;
char *newStr, *oldStr;
+ if (!*command) {
+ /* Silently ignore empty scripts -- see SF#3006842 */
+ return 1;
+ }
psPtr = FindSequence(interp, &bindPtr->patternTable, object, eventString,
1, 1, &eventMask);
if (psPtr == NULL) {
@@ -1020,7 +1024,7 @@ Tk_CreateBinding(
/*
*---------------------------------------------------------------------------
*
- * TkCreateBindingFunction --
+ * TkCreateBindingProcedure --
*
* Add a C binding to a binding table, so that future calls to
* Tk_BindEvent may callback the function in the binding.