Skip to content

Commit

Permalink
Fix simple test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
ch4rr0 committed Apr 26, 2024
1 parent 8c76c44 commit 89c86d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tokenize.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ static inline void tokenize(
//string::size_type lastPos = s.find_first_not_of(delims, 0);
string::size_type lastPos = 0;
string::size_type pos = s.find_first_of(delims, lastPos);

while (string::npos != pos || string::npos != lastPos) {
if (pos == string::npos) {
pos = s.size();
}
string::size_type rtrim = pos;
while (isspace(s[lastPos])) lastPos++;
while (rtrim > 0 && isspace(s[rtrim - 1])) rtrim--;
Expand Down

0 comments on commit 89c86d7

Please sign in to comment.