From a3f96f33e3af18dc218ac7d90c147fc3fb587d5d Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Thu, 16 May 2019 11:08:39 +0000 Subject: [PATCH] Fix recursive alias lookup --- alias.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/alias.c b/alias.c index 683f5b99c..eda00815f 100644 --- a/alias.c +++ b/alias.c @@ -91,11 +91,12 @@ static void expand_aliases_r(struct AddressList *al, struct ListHead *expn) mutt_addresslist_copy(©, alias, false); expand_aliases_r(©, expn); struct AddressNode *an2, *tmp; - an = TAILQ_LAST(©, AddressList); - TAILQ_FOREACH_REVERSE_SAFE(an2, ©, AddressList, entries, tmp) + TAILQ_FOREACH_SAFE(an2, ©, entries, tmp) { - TAILQ_INSERT_AFTER(al, an, an2, entries); + TAILQ_INSERT_BEFORE(an, an2, entries); } + an = TAILQ_PREV(an, AddressList, entries); + TAILQ_REMOVE(al, TAILQ_NEXT(an, entries), entries); } } else @@ -111,7 +112,6 @@ static void expand_aliases_r(struct AddressList *al, struct ListHead *expn) } } } - an = TAILQ_NEXT(an, entries); } -- 2.40.0