mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Fix for LIT files with '..' in filename paths
This commit is contained in:
parent
87ae95cc7a
commit
63b6550e21
@ -331,7 +331,15 @@ class ManifestItem(object):
|
||||
self.offset = offset
|
||||
self.root = root
|
||||
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):
|
||||
if hasattr(other, 'internal'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user