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:
Enrico Forestieri 2011-09-16 10:07:56 +00:00
parent ce42708bc4
commit 517cfe9266

View File

@ -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)