Return absolute path early in AbsPathForConfigVal

This prevents premature GetDataDir() calls, e.g., when config file is
not read yet.
This commit is contained in:
Hennadii Stepanov committed 2019-07-24 18:42:59 +03:00
1 parent 0626b8cbdf
commit c1f325126c
1 file changed
+3
+3
View File
@@ -1202,6 +1202,9 @@ int64_t GetStartupTime()
fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific) fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
{ {
if (path.is_absolute()) {
return path;
}
return fs::absolute(path, GetDataDir(net_specific)); return fs::absolute(path, GetDataDir(net_specific));
} }