diff --git a/lib/Driver/InitHeaderSearch.cpp b/lib/Driver/InitHeaderSearch.cpp index 3ebca8e175..a2fa826d0c 100644 --- a/lib/Driver/InitHeaderSearch.cpp +++ b/lib/Driver/InitHeaderSearch.cpp @@ -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); diff --git a/test/Driver/env-include-paths.c b/test/Driver/env-include-paths.c index de4ba5b1b7..91ca48070c 100644 --- a/test/Driver/env-include-paths.c +++ b/test/Driver/env-include-paths.c @@ -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