Trim whitespace for all config lines

FIXES: 2979
This commit is contained in:
Mike Ellery
2019-06-19 14:13:05 -07:00
committed by Manoj doshi
parent 59973a435e
commit 2c4b3d515d
2 changed files with 40 additions and 3 deletions

View File

@@ -69,6 +69,9 @@ parseIniFile (std::string const& strInput, const bool bTrim)
// Parse each line.
for (auto& strValue : vLines)
{
if (bTrim)
boost::algorithm::trim (strValue);
if (strValue.empty () || strValue[0] == '#')
{
// Blank line or comment, do nothing.
@@ -82,9 +85,6 @@ parseIniFile (std::string const& strInput, const bool bTrim)
else
{
// Another line for Section.
if (bTrim)
boost::algorithm::trim (strValue);
if (!strValue.empty ())
secResult[strSection].push_back (strValue);
}