From 4c83624ed825ca123401a45c8d2844ba6453a85b Mon Sep 17 00:00:00 2001 From: special Date: Sun, 2 Sep 2007 05:33:10 +0000 Subject: Fixed an issue that could cause empty parameters in module commands to not be sent to other servers properly git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8012 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/modules/m_spanningtree/main.cpp') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 6d71fc872..4e92f07a6 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -822,6 +822,10 @@ void ModuleSpanningTree::OnPostCommand(const std::string &command, const char** int n_translate = thiscmd->translation.size(); TranslateType translate_to; + /* To make sure that parameters with spaces, or empty + * parameters, etc, are always sent properly, *always* + * prefix the last parameter with a :. This also removes + * an extra strchr() */ for (int j = 0; j < pcnt; j++) { std::string target; @@ -837,8 +841,8 @@ void ModuleSpanningTree::OnPostCommand(const std::string &command, const char** ServerInstance->Log(DEBUG,"TRANSLATION: %s - type is %d", parameters[j], translate_to); ServerInstance->Parser->TranslateUIDs(translate_to, parameters[j], target); - - if (strchr(parameters[j],' ')) + + if (j == (pcnt - 1)) params.push_back(":" + target); else params.push_back(target); -- cgit v1.3.1-10-gc9f91