diff options
| author | memchr <118117622+memchr@users.noreply.github.com> | 2023-09-14 11:07:31 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-14 12:07:31 +0100 |
| commit | db2b72adee6e76cf25edac0eb9e69387c8dd5ee6 (patch) | |
| tree | 3d7b8f246e0cfeea05e6ee3f0bd6e7724f9d739a /src/config | |
| parent | 0dc8289b0292d3c3c35a06fdecbe41cd57a1a918 (diff) | |
config: fix relative path resolution (#3308)
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/ConfigManager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 08971318..7893cefa 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1203,8 +1203,9 @@ void CConfigManager::handleSource(const std::string& command, const std::string& std::unique_ptr<glob_t, void (*)(glob_t*)> glob_buf{new glob_t, [](glob_t* g) { globfree(g); }}; memset(glob_buf.get(), 0, sizeof(glob_t)); - if (glob(rawpath.c_str(), GLOB_TILDE, nullptr, glob_buf.get()) != 0) { - Debug::log(ERR, "source= globbing error"); + if (auto r = glob(absolutePath(rawpath, configCurrentPath).c_str(), GLOB_TILDE, nullptr, glob_buf.get()); r != 0) { + parseError = std::format("source= globbing error: {}", r == GLOB_NOMATCH ? "found no match" : GLOB_ABORTED ? "read error" : "out of memory"); + Debug::log(ERR, parseError); return; } |
