]> granicus.if.org Git - neomutt/commitdiff
Allow filename prompt when saving multiple attachments to a directory. (closes #3083)
authorKevin McCarthy <kevin@8t8.us>
Mon, 15 Jul 2013 02:48:44 +0000 (19:48 -0700)
committerKevin McCarthy <kevin@8t8.us>
Mon, 15 Jul 2013 02:48:44 +0000 (19:48 -0700)
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

index 78c34de92dc15a7387931154a8f4f7cf696d1847..8005e9c3db83aa014ee8c288645d9e09097e8678 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -992,16 +992,11 @@ int mutt_check_overwrite (const char *attname, const char *path,
     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 (NONULL (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)