mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Trim whitespace for all config lines
FIXES: 2979
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user