From 931bd2bd3334e275265da1b63454b0878a6706ca 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 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; } -- 2.40.0