From bba8278bb74a3b286b5a53004a1e88b051c66c2d Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 10 Nov 2023 23:01:27 +0100 Subject: [PATCH] Fix passing of wrong parameter to cmd executable template function `/executable vcard_photo test` Printed `Invalid usage, see '/help card_photo' for details.` So it used the subcommand instead of the command and lost one of the letters as well. This mistake got introduced in 60c197487. Where we added helper functions for the various `/executable` functions. Discovered by @H3rnand3zzz with correct solution. Fix https://github.com/profanity-im/profanity/issues/1921 --- src/command/cmd_funcs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 7f8fce4d..48790e88 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -9625,31 +9625,31 @@ _cmd_executable_template(const preference_t setting, const char* command, gchar* gboolean cmd_executable_avatar(ProfWin* window, const char* const command, gchar** args) { - return _cmd_executable_template(PREF_AVATAR_CMD, args[0], args); + return _cmd_executable_template(PREF_AVATAR_CMD, command, args); } gboolean cmd_executable_urlopen(ProfWin* window, const char* const command, gchar** args) { - return _cmd_executable_template(PREF_URL_OPEN_CMD, args[0], args); + return _cmd_executable_template(PREF_URL_OPEN_CMD, command, args); } gboolean cmd_executable_urlsave(ProfWin* window, const char* const command, gchar** args) { - return _cmd_executable_template(PREF_URL_SAVE_CMD, args[0], args); + return _cmd_executable_template(PREF_URL_SAVE_CMD, command, args); } gboolean cmd_executable_editor(ProfWin* window, const char* const command, gchar** args) { - return _cmd_executable_template(PREF_COMPOSE_EDITOR, args[0], args); + return _cmd_executable_template(PREF_COMPOSE_EDITOR, command, args); } gboolean cmd_executable_vcard_photo(ProfWin* window, const char* const command, gchar** args) { - return _cmd_executable_template(PREF_VCARD_PHOTO_CMD, args[0], args); + return _cmd_executable_template(PREF_VCARD_PHOTO_CMD, command, args); } gboolean