|
@@ -75,7 +75,7 @@ void ConfigFileParser::parse(const std::string& path) {
|
75
|
75
|
if (c == '\n') {
|
76
|
76
|
throw ParseExc(l, pos, ">", "<newline>", path);
|
77
|
77
|
} else if (c == '>') {
|
78
|
|
- parse(tmp);
|
|
78
|
+ parse(relPath(tmp, path));
|
79
|
79
|
tmp.clear();
|
80
|
80
|
s = NONE;
|
81
|
81
|
} else {
|
|
@@ -353,3 +353,12 @@ void ConfigFileParser::updateVals(size_t sec, const KeyVals& kvs) {
|
353
|
353
|
_kvs[sec][kv.first] = kv.second;
|
354
|
354
|
}
|
355
|
355
|
}
|
|
356
|
+
|
|
357
|
+// _____________________________________________________________________________
|
|
358
|
+std::string ConfigFileParser::relPath(const std::string& file,
|
|
359
|
+ std::string curF) const {
|
|
360
|
+ // pass absolute paths through unchanged
|
|
361
|
+ if (file.size() && file[0] == '/') return file;
|
|
362
|
+ curF.erase(std::find(curF.rbegin(), curF.rend(), '/').base(), curF.end());
|
|
363
|
+ return curF + "/" + file;
|
|
364
|
+}
|