Currently, if you specify a directory when saving multiple attachments
and choose (a)ll, the first attachment is saved without confirming the
filename.  Subsequent attachments prompt for the filename.


 muttlib.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)


# HG changeset patch
# User Kevin McCarthy <ke...@8t8.us>
# Date 1373854806 25200
# Branch HEAD
# Node ID 88fe65fbede7cd21d67310702ff99ed6b35a9f1a
# Parent  d3096e8796e7fcbd7ed507b7502029c7f73f159e
Allow filename prompt when saving multiple attachments to a directory. (closes #3083)

Currently, if you specify a directory when saving multiple attachments
and choose (a)ll, the first attachment is saved without confirming the
filename.  Subsequent attachments prompt for the filename.

diff --git a/muttlib.c b/muttlib.c
--- a/muttlib.c
+++ b/muttlib.c
@@ -988,25 +988,24 @@
 	  FREE (directory);		/* __FREE_CHECKED__ */
 	  return 1;
       }
     }
     else if ((rc = mutt_yesorno (_("File is a directory, save under it?"), M_YES)) != M_YES)
       return (rc == M_NO) ? 1 : -1;
 
     if (!attname || !attname[0])
-    {
       tmp[0] = 0;
-      if (mutt_get_field (_("File under directory: "), tmp, sizeof (tmp),
-				      M_FILE | M_CLEAR) != 0 || !tmp[0])
-	return (-1);
-      mutt_concat_path (fname, path, tmp, flen);
-    }
     else
-      mutt_concat_path (fname, path, mutt_basename (attname), flen);
+      strfcpy(tmp,  mutt_basename (attname), sizeof (tmp));
+
+    if (mutt_get_field (_("File under directory: "), tmp, sizeof (tmp),
+                                    M_FILE | M_CLEAR) != 0 || !tmp[0])
+      return (-1);
+    mutt_concat_path (fname, path, tmp, flen);
   }
   
   if (*append == 0 && access (fname, F_OK) == 0)
   {
     switch (mutt_multi_choice
 	    (_("File exists, (o)verwrite, (a)ppend, or (c)ancel?"), _("oac")))
     {
       case -1: /* abort */

Reply via email to