summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_spanningtree/main.cpp8
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp3
2 files changed, 7 insertions, 4 deletions
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);
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index ff5e7b203..1d6b0dfa8 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -1040,8 +1040,7 @@ void TreeSocket::Split(const std::string &line, std::deque<std::string> &n)
std::string param;
while (tokens.GetToken(param))
{
- if (!param.empty())
- n.push_back(param);
+ n.push_back(param);
}
return;
}