diff options
author | unknown <b0ris@b0ris-satellite.(none)> | 2011-12-04 20:10:43 +0200 |
---|---|---|
committer | unknown <b0ris@b0ris-satellite.(none)> | 2011-12-04 20:10:43 +0200 |
commit | 05e77a8e4f4bc392918aef3046f830dcca23be32 (patch) | |
tree | bad7e5503a18ecc476759f888f95b4c6380235c2 /client | |
parent | 9fa1566a04b2706476b493e0442035adfc952e53 (diff) |
FIX paths on windows
Diffstat (limited to 'client')
-rw-r--r-- | client/main.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/client/main.cpp b/client/main.cpp index 4b6d734..f3c3d3d 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -1,5 +1,5 @@ -#ifdef WINDOWS +#ifdef WIN32 #define UpdaterName "updater.exe" #define PathSlash "\\" #else @@ -22,8 +22,17 @@ int main(int argc, char *argv[]) Logger::Info("Starting client application\n"); string path = argv[0]; + QString dir; size_t p = path.find_last_of(PathSlash); - QString dir = QString::fromStdString(path.substr(0, p)); + if (p == string::npos) + { + dir = QString::fromStdString("."); + } + else + { + dir = QString::fromStdString(path.substr(0, p)); + } + Logger::Trace("Application path: %s\n", dir.toStdString().c_str()); // check if client should be update |