Fix for CPPPATH='#'. (Charles Crain)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 29 Apr 2002 15:55:11 +0000 (15:55 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 29 Apr 2002 15:55:11 +0000 (15:55 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@352 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Node/FS.py
src/engine/SCons/Node/FSTests.py

index d629d4066778eef048d1b052546f5f5092bb9b9b..6ccd1460ead28f82d4280793d4e0b162e9e8d5fe 100644 (file)
@@ -227,10 +227,12 @@ class FS:
         if name[0] == '#':
             directory = self.Top
             name = os.path.normpath(name[1:])
-            if name[0] == os.sep:
+            if name and (name[0] == os.sep or \
+                         name[0] == '/'):
                 # Correct such that '#/foo' is equivalent
                 # to '#foo'.
                 name = name[1:]
+            name=os.path.join('.', name)
         elif not directory:
             directory = self._cwd
         return (os.path.normpath(name), directory)
index 4cf3cb51030d183bb512a08c9d75ebef8b017d8a..ef0c72bb732e0d0457f2ec080d2644911f29b684 100644 (file)
@@ -234,6 +234,7 @@ class FSTestCase(unittest.TestCase):
             Dir_test('foo/./bar',   'foo/bar/',    sub_dir_foo_bar,   'foo/')
             Dir_test('#foo/bar',    'foo/bar/',    sub_dir_foo_bar,   'foo/')
             Dir_test('#/foo/bar',   'foo/bar/',    sub_dir_foo_bar,   'foo/')
+            Dir_test('#',           './',          sub_dir,           sub)
 
             try:
                 f2 = fs.File(string.join(['f1', 'f2'], sep), directory = d1)