Merge pull request #440 from pquentin/master

Fix get_exe_dir on OS X
This commit is contained in:
Ignacio R. Morelle 2015-08-31 02:12:42 -03:00
commit 385cd42215

View File

@ -644,17 +644,21 @@ std::string get_cwd()
}
std::string get_exe_dir()
{
#ifndef _WIN32
path self_exe("/proc/self/exe");
error_code ec;
path exe = bfs::read_symlink(self_exe, ec);
if (ec) {
return std::string();
}
return exe.parent_path().string();
#ifdef _WIN32
return get_cwd();
#else
return get_cwd();
if (bfs::exists("/proc/")) {
path self_exe("/proc/self/exe");
error_code ec;
path exe = bfs::read_symlink(self_exe, ec);
if (ec) {
return std::string();
}
return exe.parent_path().string();
} else {
return get_cwd();
}
#endif
}