mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-26 01:29:00 +08:00
Strings::split() now handles trailing delimiters
This commit is contained in:
parent
a4b419dc7b
commit
ac2f2cb478
@ -132,7 +132,7 @@ namespace vcpkg::Strings
|
||||
i = ++pos;
|
||||
pos = s.find(delimiter, pos);
|
||||
|
||||
if (pos == std::string::npos)
|
||||
if (pos == std::string::npos && i != s.length()) // The second check is so no items are added if there is nothing after the last delimiter
|
||||
{
|
||||
output.push_back(s.substr(i, s.length()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user