From 9689e3a39feb4e377509924f1796e8c31f714cbf Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Wed, 13 Nov 2024 14:34:55 -0800 Subject: [PATCH] Clarify duplicate insertion logic in parser_alias.c:process_entries Signed-off-by: Ryan Lee --- parser/parser_alias.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parser/parser_alias.c b/parser/parser_alias.c index 827128e87..635f8c880 100644 --- a/parser/parser_alias.c +++ b/parser/parser_alias.c @@ -142,8 +142,10 @@ static void process_entries(const void *nodep, VISIT value, int level unused) } if (dup) { dup->alias_ignore = true; - /* adds to the front of the list, list iteratition - * will skip it + /* The original entry->next is in dup->next, so we don't lose + * any of the original elements of the linked list. Also, by + * setting dup->alias_ignore, we trigger the check at the start + * of the loop, skipping the new entry we just inserted. */ entry->next = dup;