From: Kevin McCarthy Date: Tue, 24 Jan 2017 23:33:23 +0000 (-0800) Subject: Allow "unsubjectrc *" to remove all patterns. X-Git-Tag: mutt-1-8-rel~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7989acf60ca1e6430571c63d11fa19d4d31372fc;p=mutt Allow "unsubjectrc *" to remove all patterns. Thanks to Aaron Schrab for the original patch. --- diff --git a/doc/manual.xml.head b/doc/manual.xml.head index 14a190b4..44e38082 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -6098,9 +6098,14 @@ that either is reproduced elsewhere, or is of secondary interest. unsubjectrx + + +* + pattern + @@ -6121,8 +6126,9 @@ entire subject, not just the match! -unsubjectrx removes a given subjectrx from the substitution -list. +unsubjectrx removes a given subjectrx from the +substitution list. If * is used as the pattern, +all substitutions will be removed. @@ -10062,13 +10068,18 @@ The following are the commands understood by Mutt: pattern -format +replacement unsubjectrx + + +* + pattern + diff --git a/init.c b/init.c index cdbfb820..cf281356 100644 --- a/init.c +++ b/init.c @@ -801,6 +801,14 @@ static int parse_unreplace_list (BUFFER *buf, BUFFER *s, unsigned long data, BUF } mutt_extract_token(buf, s, 0); + + /* "*" is a special case. */ + if (!mutt_strcmp (buf->data, "*")) + { + mutt_free_replace_list (list); + return 0; + } + remove_from_replace_list(list, buf->data); return 0; }