Fix for LIT files with '..' in filename paths

This commit is contained in:
Marshall T. Vandegrift 2008-07-20 01:02:14 -04:00
parent 87ae95cc7a
commit 63b6550e21

View File

@ -331,7 +331,15 @@ class ManifestItem(object):
self.offset = offset self.offset = offset
self.root = root self.root = root
self.state = state self.state = state
self.path = self.original # 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)
def __eq__(self, other): def __eq__(self, other):
if hasattr(other, 'internal'): if hasattr(other, 'internal'):