diff options
author | Mattes D <github@xoft.cz> | 2015-05-10 21:34:31 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-05-10 21:39:14 +0200 |
commit | b356419a072076eb1ceae3dd73f6391ce5519460 (patch) | |
tree | bfd8eff367e03a5502c2eab132a15651c90b0d40 | |
parent | InfoReg: Fixed EntireCommand handling for MultiCommandHandler(). (diff) | |
download | cuberite-b356419a072076eb1ceae3dd73f6391ce5519460.tar cuberite-b356419a072076eb1ceae3dd73f6391ce5519460.tar.gz cuberite-b356419a072076eb1ceae3dd73f6391ce5519460.tar.bz2 cuberite-b356419a072076eb1ceae3dd73f6391ce5519460.tar.lz cuberite-b356419a072076eb1ceae3dd73f6391ce5519460.tar.xz cuberite-b356419a072076eb1ceae3dd73f6391ce5519460.tar.zst cuberite-b356419a072076eb1ceae3dd73f6391ce5519460.zip |
-rw-r--r-- | src/StringUtils.cpp | 7 |
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() == '\'')) { |