From 4ea98c71ee0095115db905569fac18a8a82731c1 Mon Sep 17 00:00:00 2001 From: Netboy3 <1472804+netboy3@users.noreply.github.com> Date: Thu, 28 Jul 2022 08:24:23 -0400 Subject: Fix /autoaway command logic Two issues were fixed in the parser logic: * A call to cons_bad_cmd_usage() was placed at the end of the "time" parser section that blocked reachability to both "message" and "check" parser sections. This caused "/autoaway message ..." and "/autoaway check ..." to always fail with "Invalid usage". This issue was introduced in commit 3c1e4ba. * "/autoaway message xa" with no message argument returns message set to (null). This should be fixed the same way as "/autoaway message away" was fixed in commit 3c1e4ba. --- src/command/cmd_funcs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 7e08a783..5d3673bb 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -6677,9 +6677,6 @@ cmd_autoaway(ProfWin* window, const char* const command, gchar** args) cons_bad_cmd_usage(command); return TRUE; } - } else { - cons_bad_cmd_usage(command); - return TRUE; } if (g_strcmp0(args[0], "message") == 0) { @@ -6693,7 +6690,7 @@ cmd_autoaway(ProfWin* window, const char* const command, gchar** args) } return TRUE; - } else if (g_strcmp0(args[1], "xa") == 0) { + } else if (g_strcmp0(args[1], "xa") == 0 && args[2] != NULL) { if (g_strcmp0(args[2], "off") == 0) { prefs_set_string(PREF_AUTOXA_MESSAGE, NULL); cons_show("Auto xa message cleared."); @@ -6714,6 +6711,7 @@ cmd_autoaway(ProfWin* window, const char* const command, gchar** args) return TRUE; } + cons_bad_cmd_usage(command); return TRUE; } -- cgit 1.4.1-2-gfad0