From 3866353a3cceb387eed227083ac5b7942b6cfbc2 Mon Sep 17 00:00:00 2001 From: Roland Schulz Date: Wed, 18 Feb 2015 00:50:21 -0500 Subject: [PATCH] Don't search installation prefix if binary is not found It is possible that the binary isn't accessible (e.g. Cray launcher) and it is not valid to call isEquivalent if the path is invalid. Change-Id: Idf82a8c951fdc91a2de15d310843d54961ba74eb --- src/gromacs/commandline/cmdlineprogramcontext.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gromacs/commandline/cmdlineprogramcontext.cpp b/src/gromacs/commandline/cmdlineprogramcontext.cpp index 9368e3c925..0846466980 100644 --- a/src/gromacs/commandline/cmdlineprogramcontext.cpp +++ b/src/gromacs/commandline/cmdlineprogramcontext.cpp @@ -243,9 +243,8 @@ std::string findInstallationPrefixPath(const std::string &binaryPath, bool *bSourceLayout) { *bSourceLayout = false; - // If the input path is not absolute, the binary could not be found. - // Don't search anything. - if (Path::isAbsolute(binaryPath)) + // Don't search anything if binary cannot be found. + if (Path::exists(binaryPath)) { // Remove the executable name. std::string searchPath = Path::getParentPath(binaryPath); -- 2.22.0