X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fconfig.c;h=5a1b31a9a242ed961891e46ccc6ae45d2dd778d3;hb=00114b899c187399eafbaa3cd4bbf16bd0bf467a;hp=46c3f64f82f3694769b96e211ac4e2f9a7a3b8f7;hpb=77b4d51d81340f3374ae8a97aea0177a0fbcd336;p=pazpar2-moved-to-github.git diff --git a/src/config.c b/src/config.c index 46c3f64..5a1b31a 100644 --- a/src/config.c +++ b/src/config.c @@ -1,4 +1,4 @@ -/* $Id: config.c,v 1.5 2007-01-08 18:32:35 quinn Exp $ */ +/* $Id: config.c,v 1.9 2007-01-10 10:15:23 adam Exp $ */ #include @@ -54,6 +54,7 @@ static struct conf_service *parse_service(xmlNode *node) xmlChar *merge = xmlGetProp(n, "merge"); xmlChar *type = xmlGetProp(n, "type"); xmlChar *termlist = xmlGetProp(n, "termlist"); + xmlChar *rank = xmlGetProp(n, "rank"); if (!name) { @@ -87,6 +88,11 @@ static struct conf_service *parse_service(xmlNode *node) else md->termlist = 0; + if (rank) + md->rank = atoi(rank); + else + md->rank = 0; + if (type) { if (!strcmp(type, "generic")) @@ -101,7 +107,8 @@ static struct conf_service *parse_service(xmlNode *node) return 0; } } - md->type = Metadata_type_generic; + else + md->type = Metadata_type_generic; if (sortkey) { @@ -148,6 +155,7 @@ static struct conf_service *parse_service(xmlNode *node) xmlFree(sortkey); xmlFree(merge); xmlFree(termlist); + xmlFree(rank); md_node++; } else @@ -320,7 +328,7 @@ static struct conf_retrievalprofile *parse_retrievalprofile(xmlNode *node) xmlChar *charset = xmlGetProp(n, "charset"); xmlChar *format = xmlGetProp(n, "format"); xmlChar *stylesheet = xmlGetProp(n, "stylesheet"); - bzero(m, sizeof(*m)); + memset(m, 0, sizeof(*m)); if (type) { if (!strcmp(type, "xslt")) @@ -413,7 +421,7 @@ int read_config(const char *fname) yaz_log(YLOG_FATAL, "Failed to read %s", fname); exit(1); } - if ((p = rindex(fname, '/'))) + if ((p = strrchr(fname, '/'))) { int len = p - fname; strncpy(confdir, fname, len);