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

Mikhail Glushenkov foldr at codedgers.com
Thu Oct 28 13:57:13 PDT 2010

Dan Gohman <gohman at ...> writes:

> Author: djg
> Date: Thu Oct 28 15:34:33 2010
> New Revision: 117596
> URL: http://llvm.org/viewvc/llvm-project?rev=117596&view=rev
> Log:
> Revert r117582, which reverted r77396. Searching PATH for a string
> which contains slashes is inconsistent with the meaning of PATH on
> Unix-type platforms, and pretty surprising.

Thanks, I've missed this. What about changing

  if (progName.find('/') != std::string::npos && temp.canExecute())
    return temp;


  if (progName.find('/') != std::string::npos) {
    if (temp.canExecute())
      return temp;
      return Path();

This would be consistent with the Win32 version.

Alternatively, we can change FindExecutable to take into account that canExecute
can be false for the path returned by FindProgramByName.

More information about the llvm-commits mailing list