From bc35c2916abdb343a5ce20ee2251ddfb687faf5d Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 15 Apr 2016 14:33:55 +0300 Subject: [PATCH] Skip spaces in XML row --- src/Config/Config_Common.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Config/Config_Common.cpp b/src/Config/Config_Common.cpp index bb5ddeed9..ce096355a 100644 --- a/src/Config/Config_Common.cpp +++ b/src/Config/Config_Common.cpp @@ -220,6 +220,8 @@ std::string library(const std::string& theLibName) return aLibName; } +bool BothAreSpaces(char lhs, char rhs) { return (lhs == rhs) && (lhs == ' '); } + std::string getProperty(xmlNodePtr theNode, const char* thePropName) { std::string result = ""; @@ -227,6 +229,10 @@ std::string getProperty(xmlNodePtr theNode, const char* thePropName) if (!aPropChars || aPropChars[0] == 0) return result; result = std::string(aPropChars); + + std::string::iterator new_end = std::unique(result.begin(), result.end(), BothAreSpaces); + result.erase(new_end, result.end()); + return result; } -- 2.39.2