From dddb32ee740b8fb10a29ddd4feadbdf082b9f78d Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 9 Sep 2021 21:55:03 +0000 Subject: [PATCH] Keep -? as usage. --- usr.bin/tmux/arguments.c | 6 +++++- usr.bin/tmux/cmd.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/usr.bin/tmux/arguments.c b/usr.bin/tmux/arguments.c index 1b5ec3dee10..03a5b824a13 100644 --- a/usr.bin/tmux/arguments.c +++ b/usr.bin/tmux/arguments.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arguments.c,v 1.50 2021/09/09 13:38:32 nicm Exp $ */ +/* $OpenBSD: arguments.c,v 1.51 2021/09/09 21:55:03 nicm Exp $ */ /* * Copyright (c) 2010 Nicholas Marriott @@ -153,6 +153,10 @@ args_parse(const struct args_parse *parse, struct args_value *values, flag = *string++; if (flag == '\0') break; + if (flag == '?') { + args_free(args); + return (NULL); + } if (!isalnum(flag)) { xasprintf(cause, "invalid flag -%c", flag); args_free(args); diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index 719dbdf396a..5245871fe53 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.172 2021/08/27 17:25:55 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.173 2021/09/09 21:55:03 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -502,7 +502,7 @@ cmd_parse(struct args_value *values, u_int count, const char *file, u_int line, const struct cmd_entry *entry; struct cmd *cmd; struct args *args; - char *error; + char *error = NULL; if (count == 0 || values[0].type != ARGS_STRING) { xasprintf(cause, "no command"); -- 2.20.1