From dba88edc767697f9c2a9de3c4c2fbaea6cc35f3e Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 7 Feb 2006 18:26:38 +0000 Subject: Experimental improved string handling in server links git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3127 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/modules/m_spanningtree.cpp') 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. */ -- cgit v1.2.3