From ef549970dd3f1bfcc96f4b14cd3f69c1f21f41de Mon Sep 17 00:00:00 2001 From: stevenknight Date: Wed, 11 Sep 2002 06:02:02 +0000 Subject: [PATCH] Correct interpretation of '#/../foo' on Win32. (Jeff Petkau) git-svn-id: http://scons.tigris.org/svn/scons/trunk@465 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 4 ++++ src/engine/SCons/Node/FS.py | 7 +++---- src/engine/SCons/Node/FSTests.py | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 96e19397..dc203937 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -37,6 +37,10 @@ RELEASE 0.09 - - Issue a warning when -c can't remove a target. + From Jeff Petkau: + + - Fix interpretation of '#/../foo' on Win32 systems. + From Anthony Roach: - Fixed use of command lines with spaces in their arguments, diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 7174b996..bdabdf27 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -239,13 +239,12 @@ class FS: self.__setTopLevelDir() if name[0] == '#': directory = self.Top - name = os.path.normpath(name[1:]) - if name and (name[0] == os.sep or \ - name[0] == '/'): + name = name[1:] + 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) + name = os.path.join('.', os.path.normpath(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 adcccaed..707d4a28 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -269,6 +269,8 @@ class FSTestCase(unittest.TestCase): Dir_test('.', './', sub_dir, sub) Dir_test('./.', './', sub_dir, sub) Dir_test('foo/./bar', 'foo/bar/', sub_dir_foo_bar, 'foo/') + Dir_test('#../foo', sub_foo, sub_foo, sub) + Dir_test('#/../foo', sub_foo, sub_foo, sub) 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) -- 2.26.2