From: stevenknight Date: Mon, 29 Apr 2002 15:55:11 +0000 (+0000) Subject: Fix for CPPPATH='#'. (Charles Crain) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6e20f076703a15864ee7ad06093d04773aba30a6;p=scons.git Fix for CPPPATH='#'. (Charles Crain) git-svn-id: http://scons.tigris.org/svn/scons/trunk@352 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index d629d406..6ccd1460 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -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) diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 4cf3cb51..ef0c72bb 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -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)