|
@@ -3640,11 +3640,11 @@ bool SystemTools::Split(const std::string& str,
|
|
|
while (lpos < data.length()) {
|
|
while (lpos < data.length()) {
|
|
|
std::string::size_type rpos = data.find_first_of(separator, lpos);
|
|
std::string::size_type rpos = data.find_first_of(separator, lpos);
|
|
|
if (rpos == std::string::npos) {
|
|
if (rpos == std::string::npos) {
|
|
|
- // Line ends at end of string without a newline.
|
|
|
|
|
|
|
+ // String ends at end of string without a separator.
|
|
|
lines.push_back(data.substr(lpos));
|
|
lines.push_back(data.substr(lpos));
|
|
|
return false;
|
|
return false;
|
|
|
} else {
|
|
} else {
|
|
|
- // Line ends in a "\n", remove the character.
|
|
|
|
|
|
|
+ // String ends in a separator, remove the character.
|
|
|
lines.push_back(data.substr(lpos, rpos - lpos));
|
|
lines.push_back(data.substr(lpos, rpos - lpos));
|
|
|
}
|
|
}
|
|
|
lpos = rpos + 1;
|
|
lpos = rpos + 1;
|
|
@@ -3658,7 +3658,7 @@ bool SystemTools::Split(const std::string& str,
|
|
|
std::string data(str);
|
|
std::string data(str);
|
|
|
std::string::size_type lpos = 0;
|
|
std::string::size_type lpos = 0;
|
|
|
while (lpos < data.length()) {
|
|
while (lpos < data.length()) {
|
|
|
- std::string::size_type rpos = data.find_first_of("\n", lpos);
|
|
|
|
|
|
|
+ std::string::size_type rpos = data.find_first_of('\n', lpos);
|
|
|
if (rpos == std::string::npos) {
|
|
if (rpos == std::string::npos) {
|
|
|
// Line ends at end of string without a newline.
|
|
// Line ends at end of string without a newline.
|
|
|
lines.push_back(data.substr(lpos));
|
|
lines.push_back(data.substr(lpos));
|