summaryrefslogtreecommitdiff
path: root/src/config.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-08-05 18:31:26 -0400
committerAdam <Adam@anope.org>2017-08-05 18:31:57 -0400
commit2ad76278ddac518d1c03eb15f6b0dfe518c4ca30 (patch)
treea25e1d04b1a8a111c73c49b5903a15e79945d9fd /src/config.cpp
parent23e59d9f2c69c26f8e5c0f7c5255731fe29e32a2 (diff)
Use full path to file for conf.cpp file could not be opened error message
Diffstat (limited to 'src/config.cpp')
-rw-r--r--src/config.cpp9
1 files changed, 7 insertions, 2 deletions
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())
{