diff options
-rw-r--r-- | include/config.h | 1 | ||||
-rw-r--r-- | src/config.cpp | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/config.h b/include/config.h index 8af12fe52..d6ee24554 100644 --- a/include/config.h +++ b/include/config.h @@ -78,6 +78,7 @@ namespace Configuration File(const Anope::string &, bool); ~File(); const Anope::string &GetName() const; + Anope::string GetPath() const; bool IsOpen() const; bool Open(); diff --git a/src/config.cpp b/src/config.cpp index 03ee9feb6..65a2c756c 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -665,6 +665,11 @@ const Anope::string &File::GetName() const return this->name; } +Anope::string File::GetPath() const +{ + return (this->executable ? "" : Anope::ConfigDir + "/") + this->name; +} + bool File::IsOpen() const { return this->fp != NULL; @@ -722,14 +727,14 @@ void Conf::LoadConf(File &file) return; if (!file.Open()) - throw ConfigException("File " + file.GetName() + " could not be opened."); + throw ConfigException("File " + file.GetPath() + " could not be opened."); Anope::string itemname, wordbuffer; std::stack<Block *> block_stack; int linenumber = 0; bool in_word = false, in_quote = false, in_comment = false; - Log(LOG_DEBUG) << "Start to read conf " << file.GetName(); + Log(LOG_DEBUG) << "Start to read conf " << file.GetPath(); // Start reading characters... while (!file.End()) { |