Skip to content

Commit

Permalink
root_commands: prevent linker error when plugins are disabled
Browse files Browse the repository at this point in the history
This commit fixes compilation issue with disabled plugin support
(./configure --plugins=0), where get_plugins function is unavailable.
The problem has been introduced with addition of new 'plugins info'
subcommand, where get_plugins is used in cmd_plugins_info function,
which should be conditionally available only if WITH_PLUGINS is defined.

Bug: https://bugs.gentoo.org/739510
Bug: https://bugs.gentoo.org/617604
Fixes: 6908ab7 ("Add 'plugins info' subcommand, only show plugin details there")
Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
  • Loading branch information
arkamar committed Mar 23, 2021
1 parent 75222ab commit a8196d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions root_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,7 @@ static void prplstr(GList *prpls, GString *gstr)
g_list_free(prpls);
}

#ifdef WITH_PLUGINS
static void cmd_plugins_info(irc_t *irc, char **cmd)
{
GList *l;
Expand Down Expand Up @@ -1201,14 +1202,17 @@ static void cmd_plugins_info(irc_t *irc, char **cmd)
irc_rootmsg(irc, " URL: %s", info->url);
}
}
#endif

static void cmd_plugins(irc_t *irc, char **cmd)
{
GList *prpls;
GString *gstr;

if (cmd[1] && g_strcasecmp(cmd[1], "info") == 0) {
#ifdef WITH_PLUGINS
cmd_plugins_info(irc, cmd);
#endif
return;
}

Expand Down

0 comments on commit a8196d6

Please sign in to comment.