files: when there is a slash after the dot, then there is no extension

This fixes https://savannah.gnu.org/bugs/?61071.

Bug existed since commit f429ebe3 from three days ago.
This commit is contained in:
Benno Schulenberg 2021-08-23 09:51:14 +02:00
parent d3a7f3abed
commit ae61bab60b

View File

@ -1467,7 +1467,7 @@ char *safe_tempfile(FILE **stream)
extension = strrchr(openfile->filename, '.');
if (!extension)
if (!extension || strchr(extension, '/'))
extension = openfile->filename + strlen(openfile->filename);
tempfile_name = nrealloc(tempdir, strlen(tempdir) + 12 + strlen(extension));