summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-07 18:26:38 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-07 18:26:38 +0000
commitdba88edc767697f9c2a9de3c4c2fbaea6cc35f3e (patch)
tree74122d2f9666219c8b4bd047604711f5a2772fa5 /src/modules
parentdaff96bf568a51de4e4ec460240e093c43b11ff3 (diff)
Experimental improved string handling in server links
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3127 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 10a3191f7..0710b9b0a 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -1306,17 +1306,10 @@ class TreeSocket : public InspSocket
*/
while (in_buffer.find("\n") != std::string::npos)
{
- char* line = (char*)in_buffer.c_str();
- std::string ret = "";
- while ((*line != '\n') && (*line))
- {
- if ((*line != '\r') && (*line != '\n'))
- ret = ret + *line;
- line++;
- }
- if ((*line == '\n') || (*line == '\r'))
- line++;
- in_buffer = line;
+ std::string ret = in_buffer.substr(0,in_buffer.find("\n")-1);
+ in_buffer = in_buffer.substr(in_buffer.find("\n")+1,in_buffer.length()-in_buffer.find("\n"));
+ if (ret.find("\r") != std::string::npos)
+ ret = in_buffer.substr(0,in_buffer.find("\r")-1);
/* Process this one, abort if it
* didnt return true.
*/