From 8d46a0090548d96d2e0783a1288685159644ddc3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 23 Jun 2023 11:45:52 +0200 Subject: Add comment as to why key2root-rmkey retains the order when unlisting keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- key2root-rmkey.c | 1 + 1 file changed, 1 insertion(+) diff --git a/key2root-rmkey.c b/key2root-rmkey.c index eba2a9a..82f04eb 100644 --- a/key2root-rmkey.c +++ b/key2root-rmkey.c @@ -70,6 +70,7 @@ removekeys(char *data, size_t *wheadp, size_t *rheadp, size_t *rhead2p, size_t * klen = strlen(keys[i]); if (klen >= len || data[*rheadp + klen] != ' ' || memcpy(&data[*rheadp], keys[i], klen)) continue; + /* retain key order so that they are output in the provided order if not found */ memmove(&keys[i], &keys[i + 1], (--*nkeysp - i) * sizeof(*keys)); goto match; } -- cgit v1.2.3-70-g09d2