diff --git a/src/target/target.c b/src/target/target.c index 53850bf28..8c5c8e5e3 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4968,6 +4968,17 @@ no_params: LOG_INFO("DEPRECATED target event %s; use TPIU events {pre,post}-{enable,disable}", n->name); /* END_DEPRECATED_TPIU */ + jim_getopt_obj(goi, &o); + if (Jim_Length(o) == 0) { + /* empty action, drop existing one */ + if (teap) { + list_del(&teap->list); + Jim_DecrRefCount(teap->interp, teap->body); + free(teap); + } + break; + } + bool replace = true; if (!teap) { /* create new */ @@ -4976,7 +4987,6 @@ no_params: } teap->event = n->value; teap->interp = goi->interp; - jim_getopt_obj(goi, &o); if (teap->body) Jim_DecrRefCount(teap->interp, teap->body); teap->body = Jim_DuplicateObj(goi->interp, o); diff --git a/tools/scripts/camelcase.txt b/tools/scripts/camelcase.txt index b78790200..6c6c28daa 100644 --- a/tools/scripts/camelcase.txt +++ b/tools/scripts/camelcase.txt @@ -122,6 +122,7 @@ Jim_GetWide Jim_IncrRefCount Jim_InitStaticExtensions Jim_Interp +Jim_Length Jim_ListAppendElement Jim_ListGetIndex Jim_ListLength