return (ascii_strcasecmp (subtype, "rfc822") == 0 || ascii_strcasecmp (subtype, "news") == 0);
}
+static void prepend_curdir (char *dst, size_t dstlen)
+{
+ size_t l;
+
+ if (!dst || !*dst || *dst == '/' || dstlen < 3 ||
+ /* XXX bad modularization, these are special to mutt_expand_path() */
+ !strchr ("~=+@<>!-^", *dst))
+ return;
+
+ dstlen -= 3;
+ l = strlen (dst) + 2;
+ l = (l > dstlen ? dstlen : l);
+ memmove (dst + 2, dst, l);
+ dst[0] = '.';
+ dst[1] = '/';
+ dst[l + 2] = 0;
+}
+
static int mutt_query_save_attachment (FILE *fp, BODY *body, HEADER *hdr, char **directory)
{
char *prompt;
else
buf[0] = 0;
+ prepend_curdir (buf, sizeof (buf));
+
prompt = _("Save to file: ");
while (prompt)
{
{
int append = 0;
+ prepend_curdir (buf, sizeof (buf));
strfcpy (buf, mutt_basename (NONULL (top->filename)), sizeof (buf));
if (mutt_get_field (_("Save to file: "), buf, sizeof (buf),