Fix list parsing.

This commit is contained in:
Steven Smith 2015-09-20 15:57:49 -07:00
parent 80bfbf6f21
commit 47bf2830d8

View file

@ -299,7 +299,7 @@ std::vector<std::string> cmd_parse_list(const std::string list) {
std::vector<std::string> ret; std::vector<std::string> ret;
std::string::size_type lastPos = 0; std::string::size_type lastPos = 0;
std::string::size_type pos = 0; std::string::size_type pos = 0;
while((pos = list.find(',')) != std::string::npos) { while((pos = list.find(',', lastPos)) != std::string::npos) {
ret.push_back(list.substr(lastPos, pos - lastPos)); ret.push_back(list.substr(lastPos, pos - lastPos));
lastPos = pos + 1; lastPos = pos + 1;
} }