mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix regression in filename shortening that caused loss of filename extension
This commit is contained in:
parent
fc8bcdc6f0
commit
3766f34aab
@ -54,10 +54,8 @@ def shorten_components_to(length, components):
|
||||
r = x[0] if x is components[-1] else ''
|
||||
else:
|
||||
if x is components[-1]:
|
||||
b, _, e = x.rpartition('.')
|
||||
if not b and e:
|
||||
b = e
|
||||
e = ''
|
||||
b, e = os.path.splitext(x)
|
||||
if e == '.': e = ''
|
||||
r = b[:-delta]+e
|
||||
if r.startswith('.'): r = x[0]+r
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user