From 29822a263b3b408559257e9ef2bd29167e7573fa Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 10 Jul 2013 18:11:48 +0100 Subject: Add keys for all of the compile-time paths. Also, make all paths in the config relative to their associated directory. This reverts a change in 2.0 which turned out to be a terrible idea, especially for system-wide installations. --- src/modules.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 5fc8ffc47..47c994088 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -577,7 +577,8 @@ FileReader::FileReader(const std::string& filename) void FileReader::Load(const std::string& filename) { // If the file is stored in the file cache then we used that version instead. - ConfigFileCache::iterator it = ServerInstance->Config->Files.find(filename); + std::string realName = ServerInstance->Config->Paths.PrependConfig(filename); + ConfigFileCache::iterator it = ServerInstance->Config->Files.find(realName); if (it != ServerInstance->Config->Files.end()) { this->lines = it->second; @@ -586,7 +587,7 @@ void FileReader::Load(const std::string& filename) { lines.clear(); - std::ifstream stream(filename.c_str()); + std::ifstream stream(realName.c_str()); if (!stream.is_open()) throw CoreException(filename + " does not exist or is not readable!"); -- cgit v1.2.3