From: Kevin McCarthy Date: Tue, 24 Jan 2017 23:33:23 +0000 (-0800) Subject: Allow "unsubjectrc *" to remove all patterns. X-Git-Tag: neomutt-20170225~33^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=931bd2bd3334e275265da1b63454b0878a6706ca;p=neomutt 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 da9504aac..20bd9f88c 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -7134,9 +7134,14 @@ that either is reproduced elsewhere, or is of secondary interest. unsubjectrx + + +* + pattern + @@ -7157,8 +7162,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. @@ -15398,13 +15404,18 @@ The following are the commands understood by Mutt: pattern -format +replacement unsubjectrx + + +* + pattern + diff --git a/init.c b/init.c index 90632c95c..2ee2fd882 100644 --- a/init.c +++ b/init.c @@ -928,6 +928,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; }