diff options
author | flx5 <git@flx5.com> | 2015-03-11 19:52:49 +0100 |
---|---|---|
committer | flx5 <git@flx5.com> | 2015-03-11 19:52:49 +0100 |
commit | d8ab99e944f90dffcaa597b030c6475a675679b2 (patch) | |
tree | 21fc7c10a515ebb6a66840f6cc1af8046ee523f9 | |
parent | Fixed some markup issues (diff) | |
download | cuberite-d8ab99e944f90dffcaa597b030c6475a675679b2.tar cuberite-d8ab99e944f90dffcaa597b030c6475a675679b2.tar.gz cuberite-d8ab99e944f90dffcaa597b030c6475a675679b2.tar.bz2 cuberite-d8ab99e944f90dffcaa597b030c6475a675679b2.tar.lz cuberite-d8ab99e944f90dffcaa597b030c6475a675679b2.tar.xz cuberite-d8ab99e944f90dffcaa597b030c6475a675679b2.tar.zst cuberite-d8ab99e944f90dffcaa597b030c6475a675679b2.zip |
-rw-r--r-- | src/StringUtils.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp index 343f93ce3..47fb6e5a1 100644 --- a/src/StringUtils.cpp +++ b/src/StringUtils.cpp @@ -146,6 +146,7 @@ AStringVector StringSplitWithQuotes(const AString & str, const AString & delim) size_t cutAt = 0; size_t Prev = 0; + size_t cutAtQuote = 0; while ((cutAt = str.find_first_of(delim, Prev)) != str.npos) { @@ -153,11 +154,11 @@ AStringVector StringSplitWithQuotes(const AString & str, const AString & delim) if ((current.at(0) == '"') || (current.at(0) == '\'')) { Prev += 1; - cutAt = str.find_first_of(current.at(0), Prev); - if (cutAt != str.npos) + cutAtQuote = str.find_first_of(current.at(0), Prev); + if (cutAtQuote != str.npos) { - current = str.substr(Prev, cutAt - Prev); - cutAt += 1; + current = str.substr(Prev, cutAtQuote - Prev); + cutAt = cutAtQuote + 1; } } |