aboutsummaryrefslogtreecommitdiff
path: root/cmd-list.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-02-18 23:20:21 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-02-18 23:20:21 +0000
commit293e331d69def60110bdc49b6453af905e0509b3 (patch)
tree3dbb4230607dc6bb0a40d3a1e9b71d0f56774c7a /cmd-list.c
parent2a91025581ddaa934ffa471f5b27a33d19e4ea2d (diff)
downloadrtmux-293e331d69def60110bdc49b6453af905e0509b3.tar.gz
rtmux-293e331d69def60110bdc49b6453af905e0509b3.tar.bz2
rtmux-293e331d69def60110bdc49b6453af905e0509b3.zip
Add functions to allocate and free command contexts rather than doing it all on
the stack.
Diffstat (limited to 'cmd-list.c')
-rw-r--r--cmd-list.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd-list.c b/cmd-list.c
index 1717ec3b..6820d007 100644
--- a/cmd-list.c
+++ b/cmd-list.c
@@ -97,7 +97,7 @@ cmd_list_exec(struct cmd_list *cmdlist, struct cmd_ctx *ctx)
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
if (guards)
ctx->print(ctx, "%%begin");
- n = cmd_exec(cmd, ctx);
+ n = cmd->entry->exec(cmd, ctx);
if (guards)
ctx->print(ctx, "%%end");
@@ -146,7 +146,8 @@ cmd_list_free(struct cmd_list *cmdlist)
while (!TAILQ_EMPTY(&cmdlist->list)) {
cmd = TAILQ_FIRST(&cmdlist->list);
TAILQ_REMOVE(&cmdlist->list, cmd, qentry);
- cmd_free(cmd);
+ args_free(cmd->args);
+ free(cmd);
}
free(cmdlist);
}