summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-show-options.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2022-02-14 09:10:49 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2022-02-14 09:10:49 +0000
commitf45445147c856b4dbadec29836b3f7e1d91b55bd (patch)
tree072d6685e54301c9df3cc680a9fcdbfe9f63569e /usr.bin/tmux/cmd-show-options.c
parentaecbed825492c230ecfb2eedde88c0122ba7d424 (diff)
Do not return error with -q, GitHub issue 3065.
Diffstat (limited to 'usr.bin/tmux/cmd-show-options.c')
-rw-r--r--usr.bin/tmux/cmd-show-options.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-show-options.c b/usr.bin/tmux/cmd-show-options.c
index f5c981cb1ce..2591a8dc9f5 100644
--- a/usr.bin/tmux/cmd-show-options.c
+++ b/usr.bin/tmux/cmd-show-options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-show-options.c,v 1.68 2021/10/21 08:23:48 nicm Exp $ */
+/* $OpenBSD: cmd-show-options.c,v 1.69 2022/02/14 09:10:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -103,7 +103,7 @@ cmd_show_options_exec(struct cmd *self, struct cmdq_item *item)
name = options_match(argument, &idx, &ambiguous);
if (name == NULL) {
if (args_has(args, 'q'))
- goto fail;
+ goto out;
if (ambiguous)
cmdq_error(item, "ambiguous option: %s", argument);
else
@@ -114,7 +114,7 @@ cmd_show_options_exec(struct cmd *self, struct cmdq_item *item)
&cause);
if (scope == OPTIONS_TABLE_NONE) {
if (args_has(args, 'q'))
- goto fail;
+ goto out;
cmdq_error(item, "%s", cause);
free(cause);
goto fail;
@@ -129,11 +129,12 @@ cmd_show_options_exec(struct cmd *self, struct cmdq_item *item)
cmd_show_options_print(self, item, o, idx, parent);
else if (*name == '@') {
if (args_has(args, 'q'))
- goto fail;
+ goto out;
cmdq_error(item, "invalid option: %s", argument);
goto fail;
}
+out:
free(name);
free(argument);
return (CMD_RETURN_NORMAL);