summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 5fcfe3a1c..4ba42f621 100644
--- a/src/main.c
+++ b/src/main.c
@@ -345,6 +345,8 @@ std::string GetFullProgDir(char *argv0)
}
services_bin = remainder;
+ if (services_bin.substr(0, 2) == "./")
+ services_bin = services_bin.substr(2);
std::string fullpath = static_cast<std::string>(buffer) + "/" + remainder;
std::string::size_type n = fullpath.rfind("/" SERVICES_BIN);
return std::string(fullpath, 0, n);
@@ -390,6 +392,8 @@ int main(int ac, char **av, char **envp)
#endif
binary_dir = GetFullProgDir(av[0]);
+ if (binary_dir[binary_dir.size() - 1] == '.')
+ binary_dir = binary_dir.substr(0, binary_dir.size() - 2);
#ifdef _WIN32
std::string::size_type n = binary_dir.rfind("\\");
services_dir = binary_dir.substr(0, n) + "\\data";