From 9fd8a17efc9c43b742195dc41f02c477b0101cb9 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Thu, 8 Aug 2019 20:39:01 +1000 Subject: [PATCH] jim-history: Remove unused allocation This allocation of space for the history is handled by the underlying code so there is no need to allocate a history buffer in jim-history. Signed-off-by: Steve Bennett --- jim-history.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/jim-history.c b/jim-history.c index fe6e628..1ae63d7 100644 --- a/jim-history.c +++ b/jim-history.c @@ -111,25 +111,11 @@ static const jim_subcmd_type history_command_table[] = { { NULL } }; -static int JimHistorySubCmdProc(Jim_Interp *interp, int argc, Jim_Obj *const *argv) -{ - return Jim_CallSubCmd(interp, Jim_ParseSubCmd(interp, history_command_table, argc, argv), argc, argv); -} - -static void JimHistoryDelProc(Jim_Interp *interp, void *privData) -{ - Jim_Free(privData); -} - int Jim_historyInit(Jim_Interp *interp) { - void **history; if (Jim_PackageProvide(interp, "history", "1.0", JIM_ERRMSG)) return JIM_ERR; - history = Jim_Alloc(sizeof(*history)); - *history = NULL; - - Jim_CreateCommand(interp, "history", JimHistorySubCmdProc, history, JimHistoryDelProc); + Jim_CreateCommand(interp, "history", Jim_SubCmdProc, (void *)history_command_table, NULL); return JIM_OK; } -- 2.11.4.GIT