diff options
author | 2017-01-15 22:00:56 +0000 | |
---|---|---|
committer | 2017-01-15 22:00:56 +0000 | |
commit | 4caf08d85017e79a0d85141c7f91bc1d926f93d1 (patch) | |
tree | 8af792a07aec22718908b4b08e1249bbf552fce2 /usr.bin/tmux/cmd-if-shell.c | |
parent | -q flag now needs to be checked in a couple more places. (diff) | |
download | wireguard-openbsd-4caf08d85017e79a0d85141c7f91bc1d926f93d1.tar.xz wireguard-openbsd-4caf08d85017e79a0d85141c7f91bc1d926f93d1.zip |
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.c | 8 |
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 |