From: Adam Dickmeiss Date: Tue, 20 Oct 2009 10:32:28 +0000 (+0200) Subject: Const value for record_metadata_init X-Git-Tag: v1.2.3~12 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=32622882ac1e3212da5ac2760543f4a4b3c8334f;p=pazpar2-moved-to-github.git Const value for record_metadata_init --- diff --git a/src/logic.c b/src/logic.c index 9cfcd08..0d578a0 100644 --- a/src/logic.c +++ b/src/logic.c @@ -822,15 +822,16 @@ void pazpar2_event_loop() } static struct record_metadata *record_metadata_init( - NMEM nmem, char *value, enum conf_metadata_type type) + NMEM nmem, const char *value, enum conf_metadata_type type) { struct record_metadata *rec_md = record_metadata_create(nmem); if (type == Metadata_type_generic) { - char * p = value; + char *p = nmem_strdup(nmem, value); + p = normalize7bit_generic(p, " ,/.:(["); - rec_md->data.text.disp = nmem_strdup(nmem, p); + rec_md->data.text.disp = p; rec_md->data.text.sort = 0; } else if (type == Metadata_type_year || type == Metadata_type_date) @@ -1121,7 +1122,7 @@ struct record *ingest_record(struct client *cl, const char *rec, } // non-merged metadata - rec_md = record_metadata_init(se->nmem, (char *) value, + rec_md = record_metadata_init(se->nmem, (const char *) value, ser_md->type); if (!rec_md) { @@ -1135,7 +1136,7 @@ struct record *ingest_record(struct client *cl, const char *rec, *wheretoput = rec_md; // merged metadata - rec_md = record_metadata_init(se->nmem, (char *) value, + rec_md = record_metadata_init(se->nmem, (const char *) value, ser_md->type); wheretoput = &cluster->metadata[md_field_id];