diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-13 19:25:37 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-13 19:25:37 +0000 |
commit | 6585b388cb7bfc623adb9e4dd910423f838e5d96 (patch) | |
tree | dc0ff4c6888d3a35bc3dec2152d921fd929e4008 /lib/Support/Windows/Program.inc | |
parent | 90cd06e90be1db06bc4812ae9ec96b6638847285 (diff) | |
download | external_llvm-6585b388cb7bfc623adb9e4dd910423f838e5d96.zip external_llvm-6585b388cb7bfc623adb9e4dd910423f838e5d96.tar.gz external_llvm-6585b388cb7bfc623adb9e4dd910423f838e5d96.tar.bz2 |
Have sys::FindProgramByName return a std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows/Program.inc')
-rw-r--r-- | lib/Support/Windows/Program.inc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Support/Windows/Program.inc b/lib/Support/Windows/Program.inc index 90a5cdb..cb3bc69 100644 --- a/lib/Support/Windows/Program.inc +++ b/lib/Support/Windows/Program.inc @@ -33,17 +33,17 @@ namespace llvm { using namespace sys; // This function just uses the PATH environment variable to find the program. -Path sys::FindProgramByName(const std::string& progName) { +std::string sys::FindProgramByName(const std::string &progName) { // Check some degenerate cases if (progName.length() == 0) // no program - return Path(); + return ""; Path temp; if (!temp.set(progName)) // invalid name - return Path(); + return ""; // Return paths with slashes verbatim. if (progName.find('\\') != std::string::npos || progName.find('/') != std::string::npos) - return temp; + return temp.str(); // At this point, the file name is valid and does not contain slashes. // Let Windows search for it. @@ -54,11 +54,11 @@ Path sys::FindProgramByName(const std::string& progName) { // See if it wasn't found. if (len == 0) - return Path(); + return ""; // See if we got the entire path. if (len < MAX_PATH) - return Path(buffer); + return std::string(buffer); // Buffer was too small; grow and retry. while (true) { @@ -68,9 +68,9 @@ Path sys::FindProgramByName(const std::string& progName) { // It is unlikely the search failed, but it's always possible some file // was added or removed since the last search, so be paranoid... if (len2 == 0) - return Path(); + return ""; else if (len2 <= len) - return Path(b); + return std::string(b); len = len2; } |