From 0b5efb3fb96c0cdf4fe2de60952124d66cb8d229 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 6 Jan 2014 21:55:30 +0200 Subject: [PATCH] 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. --- source/fs/dir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.43.0