Fix null entries in CPPPATH. (Gary Oberbrunner)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 30 Jul 2004 17:43:29 +0000 (17:43 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 30 Jul 2004 17:43:29 +0000 (17:43 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1016 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Node/FS.py
src/engine/SCons/Node/FSTests.py
test/CPPPATH.py

index 11532e6359d06b378f6335fc58006d7c37b67836..32d03c58d53ed177179b4c66618f5cb048eb60b5 100644 (file)
@@ -183,6 +183,9 @@ RELEASE 0.96 - XXX
     file basename.  This supports version numbers as part of shared
     library names, for example.
 
+  - Avoid problems when there are null entries (None or '') in tool
+    lists or CPPPATH.
+
   From Simon Perkins:
 
   - Fix a bug introduced in building shared libraries under MinGW.
index 31d894617aae4074af6a07a635a129a076c71c7d..e66a50d00d8e64028f51d14f4c7567b1659bb1b7 100644 (file)
@@ -1035,7 +1035,7 @@ class FS(LocalFS):
             pathlist = string.split(pathlist, os.pathsep)
         if not SCons.Util.is_List(pathlist):
             pathlist = [pathlist]
-        for path in pathlist:
+        for path in filter(None, pathlist):
             if isinstance(path, SCons.Node.Node):
                 ret.append(path)
             else:
index c5d064d44134480546df07e8e827553075abf72d..aba34811f0a375ddb8e57501053e3b6f3c5da9a8 100644 (file)
@@ -1292,6 +1292,15 @@ class RepositoryTestCase(unittest.TestCase):
         list = map(str, fs.Rsearchall(['d3', work_d4]))
         assert list == ['d3', str(work_d4)], list
 
+        list = fs.Rsearchall('')
+        assert list == [], list
+
+        list = fs.Rsearchall([None])
+        assert list == [], list
+
+        list = fs.Rsearchall([''])
+        assert list == [], list
+
         fs.BuildDir('build', '.')
 
         f = fs.File(test.workpath("work", "i_do_not_exist"))
index cb6969ecbe76f5279a41bd826f9459a66a3c1064..05a61e812c17aa6c0d3dc6020cf4f498bfadcdab 100644 (file)
@@ -194,14 +194,20 @@ test.run(program = test.workpath(variant_prog),
 
 test.up_to_date(arguments = args)
 
-# Check that a null-string CPPPATH doesn't blow up.
+# Check that neither a null-string CPPPATH nor a
+# a CPPPATH containing null values blows up.
 test.write('SConstruct', """
 env = Environment(CPPPATH = '')
-env.Library('foo', source = 'empty.c')
+env.Library('one', source = 'empty1.c')
+env = Environment(CPPPATH = [None])
+env.Library('two', source = 'empty2.c')
+env = Environment(CPPPATH = [''])
+env.Library('three', source = 'empty3.c')
 """)
 
-test.write('empty.c', """
-""")
+test.write('empty1.c', "\n")
+test.write('empty2.c', "\n")
+test.write('empty3.c', "\n")
 
 test.run(arguments = '.',
          stderr=TestSCons.noisy_ar,