diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-19 18:23:40 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-19 18:23:40 +0000 |
commit | 93230a64bc9369c726cc68d3f539b3bf66cff069 (patch) | |
tree | 0ad90cda9a0db39a058cbac8ceec67e6e7215354 /cmd-list.c | |
parent | 5f6a351df72f76f98ee1ed3494d025fe591fdb69 (diff) | |
download | rtmux-93230a64bc9369c726cc68d3f539b3bf66cff069.tar.gz rtmux-93230a64bc9369c726cc68d3f539b3bf66cff069.tar.bz2 rtmux-93230a64bc9369c726cc68d3f539b3bf66cff069.zip |
Pass return code from _exec; allow command sequences to work from the command line.
Diffstat (limited to 'cmd-list.c')
-rw-r--r-- | cmd-list.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: cmd-list.c,v 1.1 2009-01-18 14:40:48 nicm Exp $ */ +/* $Id: cmd-list.c,v 1.2 2009-01-19 18:23:40 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -60,13 +60,17 @@ bad: return (NULL); } -void +int cmd_list_exec(struct cmd_list *cmdlist, struct cmd_ctx *ctx) { struct cmd *cmd; + int n; - TAILQ_FOREACH(cmd, cmdlist, qentry) - cmd_exec(cmd, ctx); + TAILQ_FOREACH(cmd, cmdlist, qentry) { + if ((n = cmd_exec(cmd, ctx)) != 0) + return (n); + } + return (0); } void |