corr eof state SplitStr
This commit is contained in:
@@ -399,20 +399,18 @@ void SplitStr(const std::string& strVal, std::vector<std::string> &outVals)
|
|||||||
{
|
{
|
||||||
stringstream ss(strVal);
|
stringstream ss(strVal);
|
||||||
|
|
||||||
while (true) {
|
while (!ss.eof()) {
|
||||||
int c;
|
int c;
|
||||||
std::string str;
|
std::string str;
|
||||||
|
|
||||||
while (std::isspace(ss.peek()))
|
while (std::isspace(ss.peek()))
|
||||||
ss.ignore();
|
ss.ignore();
|
||||||
|
|
||||||
while (!ss.eof() && !std::isspace(c = ss.get()) && c != ',')
|
while ((c = ss.get()) != EOF && !std::isspace(c = ss.get()) && c != ',')
|
||||||
str += c;
|
str += c;
|
||||||
|
|
||||||
if (!str.empty())
|
if (!str.empty())
|
||||||
outVals.push_back(str);
|
outVals.push_back(str);
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user