Merge amd64 NDK from amd64 branch:
[reactos.git] / irc / ArchBlackmann / chomp.cpp
1 // chomp.cpp
2 // This file is (C) 2004 Royce Mitchell III
3 // and released under the BSD & LGPL licenses
4
5 #include "chomp.h"
6
7 std::string chomp ( const std::string& s )
8 {
9 const char* p = &s[0];
10 const char* p2 = &s[0] + s.size();
11 while ( p2 > p && strchr("\r\n", p2[-1]) )
12 p2--;
13 return std::string ( p, p2-p );
14 }
15