1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00

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
This commit is contained in:
Michael Vetter 2023-11-10 23:01:27 +01:00
parent 74178806a8
commit bba8278bb7

View File

@ -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