<command>attachments</command>
<arg choice="plain">
-<replaceable>?</replaceable>
+<option>?</option>
+</arg>
+
+<command>unattachments</command>
+<arg choice="plain">
+<option>*</option>
</arg>
</cmdsynopsis>
can be pasted elsewhere.
</para>
+<para>
+Entering the command <quote><command>unattachments</command> *</quote> as
+a command will Clear all attachment settings.
+</para>
</sect1>
<sect1 id="mime-lookup">
<arg choice="plain">
<replaceable>mime-type</replaceable>
</arg>
+
+<command><link linkend="attachments">attachments</link></command>
+<arg choice="plain"><option>?</option></arg>
+
+<command><link linkend="attachments">unattachments</link></command>
+<arg choice="plain"><option>*</option></arg>
+
</cmdsynopsis>
</listitem>
return parse_attach_list(buf, s, listp, err);
}
+/*
+ * Cleanup a single LIST item who's data is an ATTACH_MATCH
+ */
+static void free_attachments_data (char **data)
+{
+ if (data == NULL || *data == NULL) return;
+ ATTACH_MATCH *a = (ATTACH_MATCH *) *data;
+ regfree(&a->minor_rx);
+ FREE (&a->major);
+ FREE (data); /*__FREE_CHECKED__*/
+}
+
static int parse_unattachments (BUFFER *buf, BUFFER *s, union pointer_long_t udata, BUFFER *err)
{
char op, *p;
p = buf->data;
op = *p++;
+
+ if (op == '*')
+ {
+ mutt_free_list_generic(&AttachAllow, free_attachments_data);
+ mutt_free_list_generic(&AttachExclude, free_attachments_data);
+ mutt_free_list_generic(&InlineAllow, free_attachments_data);
+ mutt_free_list_generic(&InlineExclude, free_attachments_data);
+ _attachments_clean();
+ return 0;
+ }
+
if (op != '+' && op != '-')
{
op = '+';
#define mutt_new_rx_list() safe_calloc (1, sizeof (RX_LIST))
#define mutt_new_replace_list() safe_calloc (1, sizeof (REPLACE_LIST))
void mutt_free_list (LIST **);
+void mutt_free_list_generic (LIST **list, void (*data_free)(char **));
void mutt_free_rx_list (RX_LIST **);
void mutt_free_replace_list (REPLACE_LIST **);
LIST *mutt_copy_list (LIST *);
}
}
+void mutt_free_list_generic(LIST **list, void (*data_free)(char **))
+{
+ LIST *p;
+
+ /* wrap mutt_free_list if no data_free function was provided */
+ if (data_free == NULL)
+ {
+ mutt_free_list(list);
+ return;
+ }
+
+ if (!list) return;
+ while (*list)
+ {
+ p = *list;
+ *list = (*list)->next;
+ data_free(&p->data);
+ FREE (&p);
+ }
+}
+
LIST *mutt_copy_list (LIST *p)
{
LIST *t, *r=NULL, *l=NULL;