- num_metadata++;
- if (num_metadata)
- r->metadata = nmem_malloc(nmem, sizeof(struct conf_metadata) * num_metadata);
- r->num_metadata = num_metadata;
+ {
+ xmlChar *sortkey = xmlGetProp(n, "sortkey");
+ r->num_metadata++;
+ if (sortkey && strcmp(sortkey, "no"))
+ r->num_sortkeys++;
+ xmlFree(sortkey);
+ }
+ if (r->num_metadata)
+ r->metadata = nmem_malloc(nmem, sizeof(struct conf_metadata) * r->num_metadata);
+ else
+ r->metadata = 0;
+ if (r->num_sortkeys)
+ r->sortkeys = nmem_malloc(nmem, sizeof(struct conf_sortkey) * r->num_sortkeys);
+ else
+ r->sortkeys = 0;