From ae61bab60b69d227e6960834c0523377d94f06c2 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 23 Aug 2021 09:51:14 +0200 Subject: [PATCH] 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. --- src/files.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/files.c b/src/files.c index a974e65c..3f8b5293 100644 --- a/src/files.c +++ b/src/files.c @@ -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));