From 64eb006932afdd83471aaeff9374bd85411e9478 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Tue, 24 Jan 2017 15:33:23 -0800 Subject: [PATCH] Allow "unsubjectrc *" to remove all patterns. Thanks to Aaron Schrab for the original patch. --- doc/manual.xml.head | 17 ++++++++++++++--- init.c | 8 ++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/doc/manual.xml.head b/doc/manual.xml.head index 14a190b46..44e38082e 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 cdbfb820a..cf2813569 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; } -- 2.40.0