diff options
| author | atkawa7 <atkawa7@yahoo.com> | 2017-09-06 10:33:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-06 10:33:51 -0700 |
| commit | bafe4f2fe071503458b4f7c2bf1c645420dbc6ff (patch) | |
| tree | ebd24e412b5e2441c4f9fb97d706cbf76bab6fb8 | |
| parent | 929bf5c33dc48063c0744aa4155ad01167939305 (diff) | |
| download | vcpkg-bafe4f2fe071503458b4f7c2bf1c645420dbc6ff.tar.gz vcpkg-bafe4f2fe071503458b4f7c2bf1c645420dbc6ff.zip | |
an empty delimiter causes the split function to fail
| -rw-r--r-- | toolsrc/src/vcpkg_Strings.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 15851829d..5ad951399 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -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)) |
