summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/configreader.cpp6
-rw-r--r--src/helperfuncs.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index d35e1f5fe..6407a98e0 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -1613,7 +1613,11 @@ std::string ServerConfig::GetFullProgDir()
if (remainder[0] == '/')
return remainder;
- return std::string(buffer) + "/" + remainder;
+ std::string fullpath = std::string(buffer) + "/" + remainder;
+
+ std::string::size_type n = fullpath.rfind("/inspircd");
+
+ return std::string(fullpath, 0, n);
}
return "/";
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index f8ecc3b48..5aeabfd8b 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -431,7 +431,7 @@ bool InspIRCd::IsIdent(const char* n)
void InspIRCd::OpenLog(char** argv, int argc)
{
- Config->MyDir = ServerConfig::GetFullProgDir();
+ Config->MyDir = Config->GetFullProgDir();
if (!*this->LogFileName)
{