diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 1db8c28b70..f2a55d6420 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -447,10 +447,17 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const } // write it to a file (so far the complete file) - string const exportfile = changeExtension(incfile, ".tex"); - string const mangled = - DocFileName(changeExtension(included_file.absFilename(),".tex")). + string exportfile; + string mangled; + if (type(params()) == LISTINGS) { + exportfile = incfile; + mangled = DocFileName(included_file).mangledFilename(); + } else { + exportfile = changeExtension(incfile, ".tex"); + mangled = DocFileName(changeExtension(included_file.absFilename(), ".tex")). mangledFilename(); + } + FileName const writefile(makeAbsPath(mangled, masterBuffer->temppath())); if (!runparams.nice) diff --git a/status.16x b/status.16x index f71f85cdde..797c0a6adf 100644 --- a/status.16x +++ b/status.16x @@ -97,6 +97,8 @@ What's new - Fix bug that telephone number and location didn't appear in the output of letters (bug 5684). +- Fix a LaTeX export error that prevents the inclusion of two program listings + that differ only by file extension (bug 5681). * USER INTERFACE