diff options
author | flx5 <git@flx5.com> | 2015-03-11 04:33:17 +0100 |
---|---|---|
committer | flx5 <git@flx5.com> | 2015-03-11 04:33:17 +0100 |
commit | 451ab6860fcdf53f4e4057465acd8712aea48bce (patch) | |
tree | f36c64f453c62ee7c3d62c55edab25d209c2b893 | |
parent | Fixes #493 and #490 (diff) | |
download | cuberite-451ab6860fcdf53f4e4057465acd8712aea48bce.tar cuberite-451ab6860fcdf53f4e4057465acd8712aea48bce.tar.gz cuberite-451ab6860fcdf53f4e4057465acd8712aea48bce.tar.bz2 cuberite-451ab6860fcdf53f4e4057465acd8712aea48bce.tar.lz cuberite-451ab6860fcdf53f4e4057465acd8712aea48bce.tar.xz cuberite-451ab6860fcdf53f4e4057465acd8712aea48bce.tar.zst cuberite-451ab6860fcdf53f4e4057465acd8712aea48bce.zip |
Diffstat (limited to '')
-rw-r--r-- | src/StringUtils.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp index db406369b..084a42280 100644 --- a/src/StringUtils.cpp +++ b/src/StringUtils.cpp @@ -150,10 +150,12 @@ AStringVector StringSplitWithQuotes(const AString & str, const AString & delim) while ((cutAt = str.find_first_of(delim, Prev)) != str.npos) { AString current = str.substr(Prev, cutAt - Prev); - if (current.at(0) == '"' || current.at(0) == '\'') { + if ((current.at(0) == '"') || (current.at(0) == '\'')) + { Prev += 1; cutAt = str.find_first_of(current.at(0), Prev); - if (cutAt != str.npos) { + if (cutAt != str.npos) + { current = str.substr(Prev, cutAt - Prev); cutAt += 1; } @@ -167,7 +169,7 @@ AStringVector StringSplitWithQuotes(const AString & str, const AString & delim) { AString current = str.substr(Prev); - if (current.length() >= 2 && (current.front() == '"' || current.front() == '\'') && current.front() == current.back()) { + if ((current.length() >= 2) && ((current.front() == '"') || (current.front() == '\'')) && (current.front() == current.back())) { current = current.substr(1, current.length() - 2); } |