From f9c983eafe94d5a370e755817c513a2db1d718b1 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 29 Nov 2005 19:04:57 +0000 Subject: Line wrapping fixes git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2018 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 6a2c45ec2..42d6696e1 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -776,30 +776,40 @@ class TreeSocket : public InspSocket while (!s.eof()) { s >> param; - if ((param.c_str()[0] == ':') && (item)) + if ((param != "") && (param != "\n")) { - char* str = (char*)param.c_str(); - str++; - param = str; - std::string append; - while (!s.eof()) + if ((param.c_str()[0] == ':') && (item)) { - append = ""; - s >> append; - if (append != "") + char* str = (char*)param.c_str(); + str++; + param = str; + std::string append; + while (!s.eof()) { - param = param + " " + append; + append = ""; + s >> append; + if (append != "") + { + param = param + " " + append; + } } } + item++; + n.push_back(param); + log(DEBUG,"Line: '%s' added param; '%s'",line.c_str(),param.c_str()); } - item++; - n.push_back(param); } return n; } bool ProcessLine(std::string line) { + char* l = (char*)line.c_str(); + while ((strlen(l)) && (l[strlen(l)-1] == '\r') || (l[strlen(l)-1] == '\n')) + l[strlen(l)-1] = '\0'; + line = l; + if (line == "") + return true; Srv->Log(DEBUG,"inbound-line: '"+line+"'"); std::deque params = this->Split(line,true); std::string command = ""; @@ -1017,9 +1027,11 @@ bool DoOneToAllButSender(std::string prefix, std::string command, std::dequeLog(DEBUG,"Append "+params[x]+" to line, now: "+FullLine); } for (unsigned int x = 0; x < TreeRoot->ChildCount(); x++) { -- cgit v1.2.3