Switch '..'-removal logic to code more likely to play nice on Windows

This commit is contained in:
Marshall T. Vandegrift 2008-07-20 08:51:38 -04:00
parent 56b5b0e26c
commit 0d2c447846

View File

@ -334,14 +334,9 @@ class ManifestItem(object):
self.root = root
self.state = state
# Some paths in Fictionwise "multiformat" LIT files contain '..' (!?)
nodes = original.split('/')
path = []
for node in nodes:
if node == '..':
if path: path.pop()
continue
path.append(node)
self.path = os.path.join(*path)
path = os.path.normpath(original).replace('\\', '/')
while path.startswith('../'): path = path[3:]
self.path = path
def __eq__(self, other):
if hasattr(other, 'internal'):