diff options
Diffstat (limited to 'boost/process/detail/posix/search_path.hpp')
-rw-r--r-- | boost/process/detail/posix/search_path.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/boost/process/detail/posix/search_path.hpp b/boost/process/detail/posix/search_path.hpp index 633cf0702e..ad781e57d8 100644 --- a/boost/process/detail/posix/search_path.hpp +++ b/boost/process/detail/posix/search_path.hpp @@ -27,7 +27,9 @@ inline boost::filesystem::path search_path( for (const boost::filesystem::path & pp : path) { auto p = pp / filename; - if (!::access(p.c_str(), X_OK)) + boost::system::error_code ec; + bool file = boost::filesystem::is_regular_file(p, ec); + if (!ec && file && ::access(p.c_str(), X_OK) == 0) return p; } return ""; |