mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-23 02:57:09 +01:00
Merge pull request #1793 from atkawa7/patch-1
[vcpkg] an empty delimiter causes the split function to fail
This commit is contained in:
commit
4d7ae2fd9a
@ -136,6 +136,11 @@ namespace vcpkg::Strings
|
||||
std::vector<std::string> split(const std::string& s, const std::string& delimiter)
|
||||
{
|
||||
std::vector<std::string> output;
|
||||
|
||||
if(delimiter.empty()){
|
||||
output.push_back(s);
|
||||
return output;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
for (size_t pos = s.find(delimiter); pos != std::string::npos; pos = s.find(delimiter, pos))
|
||||
|
Loading…
x
Reference in New Issue
Block a user