summaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-03-19 15:39:41 +0000
committerSadie Powell <sadie@witchery.services>2024-03-19 15:51:55 +0000
commitbfed2e1bf5cfb250e17e91566546b38b4b9a34d8 (patch)
treeecf5ba2049ae1752cff533e060d2dce50983c04e /src/misc.cpp
parente488f294a116224d8c7f89c6c4ebad2356ba7814 (diff)
Use paths relative to data/conf in the config file.
This was done in some places already but not consistently. Closes #349.
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index 861e6ee20..8a0920fc1 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -810,8 +810,11 @@ void Anope::UpdateTime()
#endif
}
-Anope::string Anope::Expand(const Anope::string& base, const Anope::string& fragment)
+Anope::string Anope::Expand(const Anope::string &base, const Anope::string &fragment)
{
+ if (fragment.empty())
+ return ""; // We can't expand an empty fragment.
+
// The fragment is an absolute path, don't modify it.
if (std::filesystem::path(fragment.str()).is_absolute())
return fragment;