summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index bb22db3b1..d35e1f5fe 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -1605,17 +1605,18 @@ std::string ServerConfig::GetFullProgDir()
char buffer[1024];
// Get the current working directory
- if (getcwd(buffer, 1024) == NULL)
+ if (getcwd(buffer, 1024))
{
- return "";
- }
+ std::string remainder = this->argv[0];
- if (chdir(buffer) == -1)
- {
- return "";
+ /* Does argv[0] start with /? its a full path, use it */
+ if (remainder[0] == '/')
+ return remainder;
+
+ return std::string(buffer) + "/" + remainder;
}
- return buffer;
+ return "/";
}
InspIRCd* ServerConfig::GetInstance()