From fe4b8ee6697e31d2976fa26b4ad60e1eaafdd79b Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 15 Jun 2025 11:20:34 +0100 Subject: [PATCH] When a command is missing in GetQueryCommand just return (MISSING). --- src/bots.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bots.cpp b/src/bots.cpp index 6db542dd3..b507e4d63 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -311,7 +311,7 @@ Anope::string BotInfo::GetQueryCommand(const Anope::string &command, const Anope if (!command.empty()) { - Anope::string actual_command = "\036(MISSING)\036"; + Anope::string actual_command; for (const auto &[c_name, info] : this->commands) { if (info.name != command) @@ -322,8 +322,9 @@ Anope::string BotInfo::GetQueryCommand(const Anope::string &command, const Anope break; // Keep going to find a non-hidden alternative. } - if (!actual_command.empty()) - buf.append(" ").append(actual_command); + if (actual_command.empty()) + return "\036(MISSING)\036"; + buf.append(" ").append(actual_command); } if (!extra.empty())