From abd5f41ff4b5b6080e22b7a03f81079e1fc1763d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 24 Apr 2008 13:44:06 +0200 Subject: [PATCH] Try to preserve order of repeated fields (bug #2165). --- src/logic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/logic.c b/src/logic.c index afc84a9..8b15df5 100644 --- a/src/logic.c +++ b/src/logic.c @@ -1225,8 +1225,11 @@ struct record *ingest_record(struct client *cl, Z_External *rec, value, type); continue; } - rec_md->next = record->metadata[md_field_id]; - record->metadata[md_field_id] = rec_md; + wheretoput = &record->metadata[md_field_id]; + while (*wheretoput) + wheretoput = &(*wheretoput)->next; + rec_md->next = 0; + *wheretoput = rec_md; // merged metadata rec_md = record_metadata_init(se->nmem, (char *) value, -- 1.7.10.4