From c1f325126cf51d28dce8da74bfdf5cd05ab237ea Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 29 Apr 2019 22:46:34 +0300 Subject: [PATCH] Return absolute path early in AbsPathForConfigVal This prevents premature GetDataDir() calls, e.g., when config file is not read yet. --- src/util/system.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/system.cpp b/src/util/system.cpp index 72b37b918..d9e23199e 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -1202,6 +1202,9 @@ int64_t GetStartupTime() fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific) { + if (path.is_absolute()) { + return path; + } return fs::absolute(path, GetDataDir(net_specific)); }