diff options
author | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-09-02 05:33:10 +0000 |
---|---|---|
committer | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-09-02 05:33:10 +0000 |
commit | 4c83624ed825ca123401a45c8d2844ba6453a85b (patch) | |
tree | 05aec86ee0728b9943b4043aa8cabad297beb262 /src | |
parent | 8bcec56a93c8998f6ca9ac9e0a3c1b57e7bcd59c (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 3 |
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; } |