From: <ps...@us...> - 2008-07-17 10:16:38
|
Revision: 1135 http://znc.svn.sourceforge.net/znc/?rev=1135&view=rev Author: psychon Date: 2008-07-17 10:16:40 +0000 (Thu, 17 Jul 2008) Log Message: ----------- Shell module: Small cleanup We already have a special function for stripping of special chars, so why does the shell module still do it 'by hand'? Modified Paths: -------------- trunk/modules/shell.cpp Modified: trunk/modules/shell.cpp =================================================================== --- trunk/modules/shell.cpp 2008-07-14 10:44:37 UTC (rev 1134) +++ trunk/modules/shell.cpp 2008-07-17 10:16:40 UTC (rev 1135) @@ -150,9 +150,7 @@ void CShellSock::ReadLine(const CString& sData) { CString sLine = sData; - while (sLine.length() && (sLine[sLine.length() -1] == '\r' || sLine[sLine.length() -1] == '\n')) { - sLine = sLine.substr(0, sLine.length() -1); - } + sLine.TrimRight("\r\n"); CString::size_type a = sLine.find('\t'); while (a != CString::npos) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |