[llvm-commits] [llvm] r117582 - /llvm/trunk/lib/System/Unix/Program.inc

Mikhail Glushenkov foldr at codedgers.com
Thu Oct 28 12:32:58 PDT 2010


Author: foldr
Date: Thu Oct 28 14:32:58 2010
New Revision: 117582

URL: http://llvm.org/viewvc/llvm-project?rev=117582&view=rev
Log:
Revert r77396.

Original commit message:

    On "Unix", if Program::FindProgramByName is given a name containing
    slashes, just go with it, regardless of whether it looks like it will
    be executable. This follows the behavior of sh(1) more closely.

It's better when behaviour is consistent between platforms. This change also
makes FindExecutable() behave as expected on unix-likes (before this commit, it
used to always succeed).

Modified:
    llvm/trunk/lib/System/Unix/Program.inc

Modified: llvm/trunk/lib/System/Unix/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=117582&r1=117581&r2=117582&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Program.inc (original)
+++ llvm/trunk/lib/System/Unix/Program.inc Thu Oct 28 14:32:58 2010
@@ -63,7 +63,7 @@
     return Path();
   // Use the given path verbatim if it contains any slashes; this matches
   // the behavior of sh(1) and friends.
-  if (progName.find('/') != std::string::npos)
+  if (progName.find('/') != std::string::npos && temp.canExecute())
     return temp;
 
   // At this point, the file name does not contain slashes. Search for it





More information about the llvm-commits mailing list