mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #6764 (maximum_recursion_depth on shorten_components_to (function recursively calls itself on the same data))
This commit is contained in:
parent
f821c5721c
commit
d1bbd2c498
@ -55,6 +55,9 @@ def shorten_components_to(length, components):
|
|||||||
else:
|
else:
|
||||||
if x is components[-1]:
|
if x is components[-1]:
|
||||||
b, _, e = x.rpartition('.')
|
b, _, e = x.rpartition('.')
|
||||||
|
if not b and e:
|
||||||
|
b = e
|
||||||
|
e = ''
|
||||||
r = b[:-delta]+e
|
r = b[:-delta]+e
|
||||||
if r.startswith('.'): r = x[0]+r
|
if r.startswith('.'): r = x[0]+r
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user