Skip to content

Commit

Permalink
Fix StringTokenizer::peekNextToken
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews committed Jan 9, 2024
1 parent 6f70b63 commit f319443
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/io/StringTokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,8 @@ StringTokenizer::peekNextToken()
return str[pos];
}

// It's either a Number or a Word, let's
// see when it ends

pos = str.find_first_of("\n\r\t() ,", static_cast<string::size_type>(iter - str.begin()));
// It's either a Number or a Word, let's see when it ends
pos = str.find_first_of("\n\r\t() ,", pos + 1);

if(pos == string::npos) {
if(iter != str.end()) {
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/io/WKTReaderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,5 +462,15 @@ void object::test<23>
ensure(std::isnan(coords->getY(0)));
}

// EMPTY token with some white space
template<>
template<>
void object::test<24>
()
{
GeomPtr geom(wktreader.read("MULTIPOINT( EMPTY, (10 10), (20 20))"));

ensure_equals(geom->getNumGeometries(), 3u);
}

} // namespace tut

0 comments on commit f319443

Please sign in to comment.