diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 158aa4b857..148eba9d47 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -1054,9 +1054,10 @@ class Manifest(object): return href if '/' not in self.href: return href - base = os.path.dirname(self.href).split('/') + base = filter(None, os.path.dirname(os.path.normpath(self.href)).replace(os.sep, '/').split('/')) target, frag = urldefrag(href) target = target.split('/') + index = 0 for index in xrange(min(len(base), len(target))): if base[index] != target[index]: break