From 429a4ddf6ac9fd0f16667ff38a40dc437d9af2d2 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 18 Dec 2013 18:07:30 +0100 Subject: Fix FileReader not working with files specified in --- src/fileutils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fileutils.cpp b/src/fileutils.cpp index ee89cca1c..8a726ba69 100644 --- a/src/fileutils.cpp +++ b/src/fileutils.cpp @@ -29,14 +29,14 @@ 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. - std::string realName = ServerInstance->Config->Paths.PrependConfig(filename); - ConfigFileCache::iterator it = ServerInstance->Config->Files.find(realName); + ConfigFileCache::const_iterator it = ServerInstance->Config->Files.find(filename); if (it != ServerInstance->Config->Files.end()) { this->lines = it->second; } else { + const std::string realName = ServerInstance->Config->Paths.PrependConfig(filename); lines.clear(); std::ifstream stream(realName.c_str()); -- cgit v1.2.3