Assert that Process::FindInEnvPath() is passed a relative path.

It misbehaves with absolute paths. (So does path::append().)
Goes with clang r235787.

llvm-svn: 235788
This commit is contained in:
Nico Weber 2015-04-24 22:18:46 +00:00
parent 1f0f165d50
commit 7d831a5731
1 changed files with 1 additions and 0 deletions

View File

@ -29,6 +29,7 @@ using namespace sys;
Optional<std::string> Process::FindInEnvPath(const std::string& EnvName, Optional<std::string> Process::FindInEnvPath(const std::string& EnvName,
const std::string& FileName) const std::string& FileName)
{ {
assert(!path::is_absolute(FileName));
Optional<std::string> FoundPath; Optional<std::string> FoundPath;
Optional<std::string> OptPath = Process::GetEnv(EnvName); Optional<std::string> OptPath = Process::GetEnv(EnvName);
if (!OptPath.hasValue()) if (!OptPath.hasValue())