summaryrefslogtreecommitdiffstats
path: root/cmd-if-shell.c
diff options
context:
space:
mode:
authornicm <nicm>2017-01-15 22:00:56 +0000
committernicm <nicm>2017-01-15 22:00:56 +0000
commit52847a951802fda7a3ce36cdac77c34914b0ccca (patch)
tree7e5ad465e719d32f2a7d9a7c3469dec6d12448a4 /cmd-if-shell.c
parent30548461439f02ed8327f96748035685a1a26ace (diff)
It is silly for cmd_list_parse to return an integer error when it could
just return NULL.
Diffstat (limited to 'cmd-if-shell.c')
-rw-r--r--cmd-if-shell.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd-if-shell.c b/cmd-if-shell.c
index 5dfb5a19..93910f34 100644
--- a/cmd-if-shell.c
+++ b/cmd-if-shell.c
@@ -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