mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Make config file parsing more forgiving of all whitespace lines.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "ParseSection.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
@@ -32,6 +33,8 @@ section ParseSection(const std::string& strInput, const bool bTrim)
|
||||
if (strValue.empty() || strValue[0] == '#')
|
||||
{
|
||||
// Blank line or comment, do nothing.
|
||||
|
||||
nothing();
|
||||
}
|
||||
else if (strValue[0] == '[' && strValue[strValue.length()-1] == ']') {
|
||||
// New section.
|
||||
@@ -41,11 +44,12 @@ section ParseSection(const std::string& strInput, const bool bTrim)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Another line in a section.
|
||||
// Another line for section.
|
||||
if (bTrim)
|
||||
boost::algorithm::trim(strValue);
|
||||
|
||||
secResult[strSection].push_back(strValue);
|
||||
if (!strValue.empty())
|
||||
secResult[strSection].push_back(strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user