mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +00:00
Make sure an unzipped file has correct extension.
If a mask is missing, the TempFile class appends it to the filename. This may be a problem with applications relying on the extension, so explicitly add a mask.
This commit is contained in:
parent
d9c867da19
commit
c057d4e7ee
@ -362,7 +362,11 @@ bool CacheItem::Impl::tryDisplayFormat(FileName & filename, string & from)
|
||||
|
||||
zipped_ = formats.isZippedFile(filename_);
|
||||
if (zipped_) {
|
||||
TempFile tempfile(filename_.toFilesystemEncoding());
|
||||
string tempname = unzippedFileName(filename_.toFilesystemEncoding());
|
||||
string const ext = getExtension(tempname);
|
||||
if (!ext.empty())
|
||||
tempname = changeExtension(tempname, "");
|
||||
TempFile tempfile(tempname + "-XXXXXX." + ext);
|
||||
tempfile.setAutoRemove(false);
|
||||
unzipped_filename_ = tempfile.name();
|
||||
if (unzipped_filename_.empty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user