Discussion:
[maildropl] [jorrit@jorrit.de: Re: maildrop: Subpatterns should not be processed in foreach]
Osamu Aoki
2015-05-09 16:31:43 UTC
Permalink
Hi,

Just to be sure, I am forwarding this to mailing list.

Original bug report can be seen at: http://bugs.debian.org/783539

----- Forwarded message from Jö Fahlke <***@jorrit.de> -----

Date: Tue, 28 Apr 2015 19:31:56 +0200
From: Jö Fahlke <***@jorrit.de>
To: Sam Varshavchik <***@courier-mta.com>
Cc: Osamu Aoki <***@debian.org>
Subject: Re: maildrop: Subpatterns should not be processed in foreach
User-Agent: Mutt/1.5.23 (2014-03-12)

Hi!

I just found the time to develope a patch and sent it to the bts. It is
attached here for convenience as well.

Regards,
Jö.
--
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729

A mathematician is a device to turn coffee into theorems.
-- Paul Erdős

From d5a3f9de969c7b4014373a9f6ee300b495d5c792 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6=20Fahlke?= <***@jorrit.de>
Date: Tue, 28 Apr 2015 18:37:25 +0200
Subject: maildrop: Don't include matched subpatterns in foreach iteration.

---
maildrop/search.C | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/maildrop/search.C b/maildrop/search.C
index 0823fbd..c50f8e9 100644
--- a/maildrop/search.C
+++ b/maildrop/search.C
@@ -337,7 +337,7 @@ void Search::init_match_vars(const char *str, int nranges, int *offsets,
}
}

- if (foreachp)
+ if (cnt == 0 && foreachp)
{
*foreachp += v;
*foreachp += '\0';
--
2.1.4





----- End forwarded message -----
Sam Varshavchik
2015-05-10 00:17:55 UTC
Permalink
Post by Osamu Aoki
Hi,
Just to be sure, I am forwarding this to mailing list.
Original bug report can be seen at: http://bugs.debian.org/783539
The patch makes sense to me.

Loading...