diff --git a/test.cpp b/test.cpp index c284b1b0..252fc17f 100644 --- a/test.cpp +++ b/test.cpp @@ -512,7 +512,7 @@ void SetArgvPathHint(const char* argv0, std::string& pathHint) // Is it possible for realpath to fail? struct stat buf; int x; x = lstat(pathHint.c_str(), &buf); - if (S_ISLNK(buf.st_mode)) + if (x != 0 || S_ISLNK(buf.st_mode)) pathHint.clear(); #endif