mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 14:29:21 +00:00
Make sure that a generated temporary filename doesn't end with a dot.
This may happen if the extension is empty, and a filename ending with a dot may give troubles on Windows.
This commit is contained in:
parent
c057d4e7ee
commit
ee6583ff94
@ -364,9 +364,10 @@ bool CacheItem::Impl::tryDisplayFormat(FileName & filename, string & from)
|
||||
if (zipped_) {
|
||||
string tempname = unzippedFileName(filename_.toFilesystemEncoding());
|
||||
string const ext = getExtension(tempname);
|
||||
tempname = changeExtension(tempname, "") + "-XXXXXX";
|
||||
if (!ext.empty())
|
||||
tempname = changeExtension(tempname, "");
|
||||
TempFile tempfile(tempname + "-XXXXXX." + ext);
|
||||
tempname = addExtension(tempname, ext);
|
||||
TempFile tempfile(tempname);
|
||||
tempfile.setAutoRemove(false);
|
||||
unzipped_filename_ = tempfile.name();
|
||||
if (unzipped_filename_.empty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user