zipped_ = formats.isZippedFile(filename_);
if (zipped_) {
- TempFile tempfile(filename_.toFilesystemEncoding());
+ string tempname = unzippedFileName(filename_.toFilesystemEncoding());
+ string const ext = getExtension(tempname);
+ tempname = changeExtension(tempname, "") + "-XXXXXX";
+ if (!ext.empty())
+ tempname = addExtension(tempname, ext);
+ TempFile tempfile(tempname);
tempfile.setAutoRemove(false);
unzipped_filename_ = tempfile.name();
if (unzipped_filename_.empty()) {