]> granicus.if.org Git - neomutt/commitdiff
Note when mutt_edit_attachment fails and display error instead of prompting
authorBrendan Cully <brendan@kublai.com>
Sat, 3 Sep 2005 23:22:30 +0000 (23:22 +0000)
committerBrendan Cully <brendan@kublai.com>
Sat, 3 Sep 2005 23:22:30 +0000 (23:22 +0000)
to abort an unmodified file. Closes: #2051.

attach.c
send.c

index 5ba1cce4d6dcd51c7e5cadba7c6ccabb8cb75e7c..a8521b3dfedcb7863dcc8d1d08b104bb6f95d2ad 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -256,12 +256,16 @@ int mutt_edit_attachment (BODY *a)
       {
        /* For now, editing requires a file, no piping */
        mutt_error _("Mailcap Edit entry requires %%s");
+        goto bailout;
       }
       else
       {
        mutt_endwin (NULL);
        if (mutt_system (command) == -1)
+        {
          mutt_error (_("Error running \"%s\"!"), command);
+          goto bailout;
+        }
       }
     }
   }
diff --git a/send.c b/send.c
index 3de3e5d9a5369270a43383fe9e207ca0d4557437..29b31987742874a3d031914e295c51f38b1bf5b3 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1353,7 +1353,7 @@ ci_send_message (int flags,               /* send mode */
   {
     struct stat st;
     time_t mtime = mutt_decrease_mtime (msg->content->filename, NULL);
-    
+
     mutt_update_encoding (msg->content);
 
     /*
@@ -1373,7 +1373,10 @@ ci_send_message (int flags,              /* send mode */
     {
       /* If the this isn't a text message, look for a mailcap edit command */
       if (mutt_needs_mailcap (msg->content))
-       mutt_edit_attachment (msg->content);
+      {
+       if (!mutt_edit_attachment (msg->content))
+          goto cleanup;
+      }
       else if (!Editor || mutt_strcmp ("builtin", Editor) == 0)
        mutt_builtin_editor (msg->content->filename, msg, cur);
       else if (option (OPTEDITHDRS))