summaryrefslogtreecommitdiffstats
path: root/src/StringUtils.cpp
diff options
context:
space:
mode:
authorflx5 <git@flx5.com>2015-03-11 20:02:11 +0100
committerflx5 <git@flx5.com>2015-03-11 20:02:11 +0100
commitf6912bd01c80a1031c1d0f69a87eca4f0990da66 (patch)
treed8b603551c2924a4d25289c5fcb767f3cef6c669 /src/StringUtils.cpp
parentFixed issue with quotes not appearing in pairs (diff)
downloadcuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar.gz
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar.bz2
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar.lz
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar.xz
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.tar.zst
cuberite-f6912bd01c80a1031c1d0f69a87eca4f0990da66.zip
Diffstat (limited to 'src/StringUtils.cpp')
-rw-r--r--src/StringUtils.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp
index 47fb6e5a1..95b3c7400 100644
--- a/src/StringUtils.cpp
+++ b/src/StringUtils.cpp
@@ -170,7 +170,12 @@ 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 the remant is wrapped in matching quotes, remove them:
+ if (
+ (current.length() >= 2) &&
+ ((current.front() == '"') || (current.front() == '\'')) &&
+ (current.front() == current.back())
+ )
{
current = current.substr(1, current.length() - 2);
}