summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-if-shell.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-01-15 22:00:57 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-01-15 22:00:57 +0000
commit5d3119bb91b3d6264056c4e0baafd42a06aefce4 (patch)
treef4dcfef47012b60579fefe43ba1ea250336b1a8d /usr.bin/tmux/cmd-if-shell.c
parenta3eac327b2aa10fd0c421dd11233337282f9b549 (diff)
It is silly for cmd_list_parse to return an integer error when it could
just return NULL.
Diffstat (limited to 'usr.bin/tmux/cmd-if-shell.c')
-rw-r--r--usr.bin/tmux/cmd-if-shell.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-if-shell.c b/usr.bin/tmux/cmd-if-shell.c
index 755de93d036..9651287817d 100644
--- a/usr.bin/tmux/cmd-if-shell.c
+++ b/usr.bin/tmux/cmd-if-shell.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-if-shell.c,v 1.48 2016/10/16 19:04:05 nicm Exp $ */
+/* $OpenBSD: cmd-if-shell.c,v 1.49 2017/01/15 22:00:56 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -96,7 +96,8 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item)
free(shellcmd);
if (cmd == NULL)
return (CMD_RETURN_NORMAL);
- if (cmd_string_parse(cmd, &cmdlist, NULL, 0, &cause) != 0) {
+ cmdlist = cmd_string_parse(cmd, NULL, 0, &cause);
+ if (cmdlist == NULL) {
if (cause != NULL) {
cmdq_error(item, "%s", cause);
free(cause);
@@ -167,7 +168,8 @@ cmd_if_shell_callback(struct job *job)
if (cmd == NULL)
goto out;
- if (cmd_string_parse(cmd, &cmdlist, file, line, &cause) != 0) {
+ cmdlist = cmd_string_parse(cmd, file, line, &cause);
+ if (cmdlist == NULL) {
if (cause != NULL)
new_item = cmdq_get_callback(cmd_if_shell_error, cause);
else