From 5d3119bb91b3d6264056c4e0baafd42a06aefce4 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 15 Jan 2017 22:00:57 +0000 Subject: It is silly for cmd_list_parse to return an integer error when it could just return NULL. --- usr.bin/tmux/cmd-if-shell.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'usr.bin/tmux/cmd-if-shell.c') 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 @@ -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 -- cgit v1.2.3