mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Replace leading period in filenames with an underscore
This commit is contained in:
parent
bcdd6d474a
commit
43fcdf8ca9
@ -85,6 +85,8 @@ def sanitize_file_name(name, substitute='_', as_unicode=False):
|
||||
# Windows doesn't like path components that end with a period
|
||||
if one.endswith('.'):
|
||||
one = one[:-1]+'_'
|
||||
if one.startswith('.'):
|
||||
one = '_' + one[1:]
|
||||
return one
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user