Bug fix, CPATH="" does not add '.' to search path.

llvm-svn: 57072
This commit is contained in:
Daniel Dunbar 2008-10-04 20:58:18 +00:00
parent 23bd6cc156
commit 3ca0a634c2
2 changed files with 1 additions and 2 deletions

View File

@ -81,7 +81,7 @@ void InitHeaderSearch::AddPath(const std::string &Path, IncludeDirGroup Group,
void InitHeaderSearch::AddEnvVarPaths(const char *Name) {
const char* at = getenv(Name);
if (!at)
if (!at || *at == 0) // Empty string should not add '.' path.
return;
const char* delim = strchr(at, llvm::sys::PathSeparator);

View File

@ -3,7 +3,6 @@
// RUN: env CPATH="xyz:xyz" clang -fsyntax-only -verify -DAS_SOURCE %s &&
// RUN: env CPATH="xyz::xyz" clang -fsyntax-only -verify -DSHOULD_FIND -DAS_SOURCE %s &&
// RUN: env CPATH="../Driver" clang -fsyntax-only -verify -DSHOULD_FIND -DAS_SOURCE %s
// XFAIL
#ifdef AS_SOURCE
#undef AS_SOURCE