summaryrefslogtreecommitdiffstats
path: root/cmd-string.c
authornicm <nicm>2009-01-18 14:40:48 (GMT)
committer nicm <nicm>2009-01-18 14:40:48 (GMT)
commit0c41a79a6db40b1ab93fb26c97cc3b2b9d45b58c (patch) (side-by-side diff)
tree2083b296081358280afa8dc80d6a73242baac6a1 /cmd-string.c
parent0d61fd08c3a39dce98efd2c6bdddb26848189cf6 (diff)
downloadtmux-old-0c41a79a6db40b1ab93fb26c97cc3b2b9d45b58c.zip
tmux-old-0c41a79a6db40b1ab93fb26c97cc3b2b9d45b58c.tar.gz
tmux-old-0c41a79a6db40b1ab93fb26c97cc3b2b9d45b58c.tar.bz2
Support command sequences separated by " ; ". Also clean up command printing.
Diffstat (limited to 'cmd-string.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cmd-string.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd-string.c b/cmd-string.c
index f35d240..7486325 100644
--- a/cmd-string.c
+++ b/cmd-string.c
@@ -53,7 +53,7 @@ cmd_string_ungetc(unused const char *s, size_t *p)
* string, or NULL for empty command.
*/
int
-cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
+cmd_string_parse(const char *s, struct cmd_list **cmdlist, char **cause)
{
size_t p;
int ch, argc, rval;
@@ -67,7 +67,7 @@ cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
xasprintf(cause, "assignment failed: %s", s);
return (-1);
}
- *cmd = NULL;
+ *cmdlist = NULL;
return (0);
}
@@ -79,7 +79,7 @@ cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
*cause = NULL;
- *cmd = NULL;
+ *cmdlist = NULL;
rval = -1;
p = 0;
@@ -131,7 +131,8 @@ cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
if (argc == 0)
goto out;
- if ((*cmd = cmd_parse(argc, argv, cause)) == NULL)
+ *cmdlist = cmd_list_parse(argc, argv, cause);
+ if (*cmdlist == NULL)
goto out;
rval = 0;