Correct interpretation of '#/../foo' on Win32. (Jeff Petkau)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 11 Sep 2002 06:02:02 +0000 (06:02 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 11 Sep 2002 06:02:02 +0000 (06:02 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@465 fdb21ef1-2011-0410-befe-b5e4ea1792b1

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

index 96e1939761f981912df788a2d2406eb4def5f408..dc203937296dcb99c07b4944605e980532cad218 100644 (file)
@@ -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,
index 7174b9961147834fbd5b982b8d01fba9142504b7..bdabdf27bae32fba5b11630dd84b6c61cc06f61c 100644 (file)
@@ -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)
index adcccaed0399178f0dfcda745fd070e320224fbe..707d4a28a6d3374d33d86e4e71134c6b15e1fb57 100644 (file)
@@ -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)