From: Mikko Rasa Date: Mon, 6 Jan 2014 19:55:30 +0000 (+0200) Subject: Change get_bin_dir logic to assume exe in cwd if not otherwise found X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0b5efb3fb96c0cdf4fe2de60952124d66cb8d229;p=libs%2Fcore.git Change get_bin_dir logic to assume exe in cwd if not otherwise found Windows has an implicit . component in $PATH, which can cause programs started from command line to not find their executable in $PATH. This fixes the issue, and should not cause undue trouble on other systems. --- diff --git a/source/fs/dir.cpp b/source/fs/dir.cpp index 0b68732..c0583cc 100644 --- a/source/fs/dir.cpp +++ b/source/fs/dir.cpp @@ -47,7 +47,8 @@ const Path &get_bin_dir(const string &argv0) break; } } - else + + if(exe.empty()) exe = realpath(argv0); last_argv0 = argv0;