mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Switch '..'-removal logic to code more likely to play nice on Windows
This commit is contained in:
parent
56b5b0e26c
commit
0d2c447846
@ -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'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user