mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Check whether the filename is really a file. Also protect against recursive
inclusions. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39690 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ce42708bc4
commit
517cfe9266
@ -115,12 +115,13 @@ def gather_files(curfile, incfiles, lyx2lyx):
|
||||
if not os.path.isabs(file):
|
||||
file = os.path.join(curdir, file)
|
||||
file_exists = False
|
||||
for ext in extlist:
|
||||
if os.path.exists(file + ext):
|
||||
file = file + ext
|
||||
file_exists = True
|
||||
break
|
||||
if file_exists:
|
||||
if not os.path.isdir(file):
|
||||
for ext in extlist:
|
||||
if os.path.exists(file + ext):
|
||||
file = file + ext
|
||||
file_exists = True
|
||||
break
|
||||
if file_exists and not file in incfiles:
|
||||
incfiles.append(abspath(file))
|
||||
if recursive:
|
||||
gather_files(file, incfiles, lyx2lyx)
|
||||
|
Loading…
Reference in New Issue
Block a user