summaryrefslogtreecommitdiffstats
path: root/src/StringUtils.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-05-11 10:39:45 +0200
committerMattes D <github@xoft.cz>2015-05-11 10:39:45 +0200
commit7d66162e3c339e82d56e5144d466cab97eca82ab (patch)
tree5f3f1a00f704c7def6fc18b98c296e964f218815 /src/StringUtils.cpp
parentMerge pull request #1977 from mc-server/warnings (diff)
parentAPIDump: Added linkification to hook return values. (diff)
downloadcuberite-7d66162e3c339e82d56e5144d466cab97eca82ab.tar
cuberite-7d66162e3c339e82d56e5144d466cab97eca82ab.tar.gz
cuberite-7d66162e3c339e82d56e5144d466cab97eca82ab.tar.bz2
cuberite-7d66162e3c339e82d56e5144d466cab97eca82ab.tar.lz
cuberite-7d66162e3c339e82d56e5144d466cab97eca82ab.tar.xz
cuberite-7d66162e3c339e82d56e5144d466cab97eca82ab.tar.zst
cuberite-7d66162e3c339e82d56e5144d466cab97eca82ab.zip
Diffstat (limited to '')
-rw-r--r--src/StringUtils.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp
index 4adc6a0a0..12bd3ada1 100644
--- a/src/StringUtils.cpp
+++ b/src/StringUtils.cpp
@@ -150,6 +150,13 @@ AStringVector StringSplitWithQuotes(const AString & str, const AString & delim)
while ((cutAt = str.find_first_of(delim, Prev)) != str.npos)
{
+ if (cutAt == Prev)
+ {
+ // Empty string due to multiple whitespace / whitespace at the beginning of the input
+ // Just skip it
+ Prev = Prev + 1;
+ continue;
+ }
AString current = str.substr(Prev, cutAt - Prev);
if ((current.front() == '"') || (current.front() == '\''))
{