Skip to content

Commit c1f3251

Browse files
committed
Return absolute path early in AbsPathForConfigVal
This prevents premature GetDataDir() calls, e.g., when config file is not read yet.
1 parent 0626b8c commit c1f3251

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/util/system.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,9 @@ int64_t GetStartupTime()
12021202

12031203
fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
12041204
{
1205+
if (path.is_absolute()) {
1206+
return path;
1207+
}
12051208
return fs::absolute(path, GetDataDir(net_specific));
12061209
}
12071210

0 commit comments

Comments
 (0)