[cfe-commits] r57072 - in /cfe/trunk: lib/Driver/InitHeaderSearch.cpp test/Driver/env-include-paths.c

Daniel Dunbar daniel at zuster.org
Sat Oct 4 13:58:18 PDT 2008


Author: ddunbar
Date: Sat Oct  4 15:58:18 2008
New Revision: 57072

URL: http://llvm.org/viewvc/llvm-project?rev=57072&view=rev
Log:
Bug fix, CPATH="" does not add '.' to search path.

Modified:
    cfe/trunk/lib/Driver/InitHeaderSearch.cpp
    cfe/trunk/test/Driver/env-include-paths.c

Modified: cfe/trunk/lib/Driver/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/InitHeaderSearch.cpp?rev=57072&r1=57071&r2=57072&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Driver/InitHeaderSearch.cpp Sat Oct  4 15:58:18 2008
@@ -81,7 +81,7 @@
 
 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);

Modified: cfe/trunk/test/Driver/env-include-paths.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/env-include-paths.c?rev=57072&r1=57071&r2=57072&view=diff

==============================================================================
--- cfe/trunk/test/Driver/env-include-paths.c (original)
+++ cfe/trunk/test/Driver/env-include-paths.c Sat Oct  4 15:58:18 2008
@@ -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





More information about the cfe-commits mailing list