# HG changeset patch # User David Demelier # Date 1626334413 -7200 # Node ID d0adbcc0768e6009eb0c2fd820ceb7201f98ccd0 # Parent fbf02f5ef8e34188e33f163e1da0d67908d1c6fd irccd: fix plugin-load command diff -r fbf02f5ef8e3 -r d0adbcc0768e irccd/peer.c --- a/irccd/peer.c Wed Jul 14 21:13:03 2021 +0200 +++ b/irccd/peer.c Thu Jul 15 09:33:33 2021 +0200 @@ -283,12 +283,16 @@ cmd_plugin_load(struct peer *p, char *line) { struct irc_plugin *plg; + const char *args[1]; - if (!(plg = irc_bot_plugin_find(line, NULL))) + if (parse(line, args, 1) != 1) + return EINVAL; + if (!(plg = irc_bot_plugin_find(args[0], NULL))) peer_send(p, "could not load plugin: %s", strerror(errno)); - - /* TODO: report error if fails to open. */ - irc_bot_plugin_add(plg); + else { + /* TODO: report error if fails to open. */ + irc_bot_plugin_add(plg); + } return ok(p); }