1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
diff --git a/server/loadConfig.cpp b/server/loadConfig.cpp
index b9d6eac..a85735a 100644
--- a/server/loadConfig.cpp
+++ b/server/loadConfig.cpp
@@ -84,8 +84,9 @@ mergePropertyTrees (boost::property_tree::ptree &ptMerged,
auto it = ptSecond.begin();
for (; it != ptSecond.end(); ++it) {
- boost::property_tree::ptree child = ptMerged.get_child (it->first.data(),
- boost::property_tree::ptree() );
+ boost::property_tree::ptree default_ptree;
+ boost::property_tree::ptree child = ptMerged.get_child_optional(it->first.data())
+ .value_or(default_ptree);
mergePropertyTrees (child, it->second, level + 1);
ptMerged.erase (it->first.data() );
@@ -192,7 +193,7 @@ loadModulesConfigFromDir (boost::property_tree::ptree &config,
for ( boost::filesystem::directory_iterator itr ( dir ); itr != end_itr;
++itr ) {
- if (boost::filesystem::is_regular (*itr) ) {
+ if (boost::filesystem::is_regular_file (*itr) ) {
const std::string pathStr = itr->path().string();
try {
boost::property_tree::ptree moduleConfig;
@@ -235,7 +236,7 @@ loadModulesConfig (boost::property_tree::ptree &config,
for (std::string location : locations) {
boost::filesystem::path dir (location);
- dir.normalize();
+ dir = dir.lexically_normal();
loadModulesConfigFromDir (config, dir, dir);
}
|