]> jfr.im git - irc/rizon/znc.git/commitdiff
Shell module: Small cleanup
authorpsychon <redacted>
Thu, 17 Jul 2008 10:16:40 +0000 (10:16 +0000)
committerpsychon <redacted>
Thu, 17 Jul 2008 10:16:40 +0000 (10:16 +0000)
We already have a special function for stripping of special chars, so
why does the shell module still do it 'by hand'?

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1135 726aef4b-f618-498e-8847-2d620e286838

modules/shell.cpp

index e9dabcadbc424fbc958a7471eb1603e21a9ca217..02f4513b5131fdd71f2d14b29519e1c2e470446f 100644 (file)
@@ -150,9 +150,7 @@ private:
 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) {