From: Adam Dickmeiss Date: Thu, 24 Apr 2008 11:44:06 +0000 (+0200) Subject: Try to preserve order of repeated fields (bug #2165). X-Git-Tag: v1.0.9~10 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=abd5f41ff4b5b6080e22b7a03f81079e1fc1763d;p=pazpar2-moved-to-github.git Try to preserve order of repeated fields (bug #2165). --- 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,