]> granicus.if.org Git - neomutt/commitdiff
Remove unnecessary strcmp for mutt_view_attachment()
authorKevin McCarthy <kevin@8t8.us>
Sat, 22 Jun 2019 19:54:40 +0000 (12:54 -0700)
committerRichard Russon <rich@flatcap.org>
Mon, 24 Jun 2019 15:20:39 +0000 (16:20 +0100)
mutt_rfc1524_expand_filename() runs the result through
mutt_adv_mktemp(), which will sanitize and relocate the filename under
$tmpdir.  The strcmp() is unneeded and distracting to the program
logic; none of the other routines perform or need this check.

Co-authored-by: Richard Russon <rich@flatcap.org>
mutt_attach.c

index 66978ac5124f2ef8a5e43a7678a9becb13c10762..43d82392908560853f160c2abafc44f72ae2d9c4 100644 (file)
@@ -458,7 +458,7 @@ int mutt_view_attachment(FILE *fp, struct Body *a, enum ViewAttachMode mode,
 
     if (mutt_rfc1524_expand_filename(entry->nametemplate, fname, tmpfile))
     {
-      if (!fp && (mutt_str_strcmp(mutt_b2s(tmpfile), a->filename) != 0))
+      if (!fp)
       {
         /* send case: the file is already there */
         if (mutt_file_symlink(a->filename, mutt_b2s(tmpfile)) == -1)