fixed pbm in extract_line : delete the line and the newline sequence character
+ fixed pbm n _cgi_pos : last return is npos, not pos
This commit is contained in:
@@ -198,8 +198,8 @@ std::string str_tolower(std::string str)
|
||||
}
|
||||
|
||||
// identify a line in a string, by delim (ex. '\n')
|
||||
// delete this line from the string
|
||||
// and return the deleted line
|
||||
// delete this line from the string (and the following nl sequence characters)
|
||||
// and return the deleted line (without the followinf nl sequence characters)
|
||||
std::string
|
||||
extract_line(std::string & str, size_t pos, std::string delim)
|
||||
{
|
||||
@@ -220,7 +220,7 @@ std::string
|
||||
len = end - begin;
|
||||
|
||||
del_str = str.substr(begin, len);
|
||||
str.erase(begin, len);
|
||||
str.erase(begin, len + delim.size());
|
||||
return del_str;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user