]> granicus.if.org Git - neomutt/commitdiff
fix re-opening attachments
authorRichard Russon <rich@flatcap.org>
Sun, 23 Jun 2019 12:24:40 +0000 (13:24 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 15 Jul 2019 10:19:52 +0000 (11:19 +0100)
When opening an attachment with a two part suffix, e.g. `.tar.gz`
NeoMutt created a temporary file with just `.gz`.

Hack the splitting logic to give a useful suffix

Fixes: #1699
muttlib.c

index 48b8369f3390fa324250ad3697397f0d4ba0c3c4..72d462c004f84d073f410fc92f24787706738414 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -104,7 +104,7 @@ void mutt_adv_mktemp(struct Buffer *buf)
     if ((lstat(mutt_b2s(buf), &sb) == -1) && (errno == ENOENT))
       goto out;
 
-    char *suffix = strrchr(prefix->data, '.');
+    char *suffix = strchr(prefix->data, '.');
     if (suffix)
     {
       *suffix = '\0';