summaryrefslogtreecommitdiffstats
path: root/src/StringUtils.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2015-05-19 19:43:19 +0200
committerAlexander Harkness <bearbin@gmail.com>2015-05-19 19:43:19 +0200
commitcbb425f027a7b51c4aed5d3399b26cf325c4c8ce (patch)
tree6a35f2c9c44b7d3d5142635178bf1ec9ca5e428c /src/StringUtils.cpp
parentUpdated Core. (diff)
parentMerge pull request #2057 from Seadragon91/master (diff)
downloadcuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar
cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar.gz
cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar.bz2
cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar.lz
cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar.xz
cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar.zst
cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.zip
Diffstat (limited to 'src/StringUtils.cpp')
-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() == '\''))
{