Include netinet/in.h for IP resolve types. Makes pazpar2 run happily
[pazpar2-moved-to-github.git] / src / config.c
index 2de8479..5a1b31a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: config.c,v 1.6 2007-01-08 19:39:12 quinn Exp $ */
+/* $Id: config.c,v 1.9 2007-01-10 10:15:23 adam Exp $ */
 
 #include <string.h>
 
@@ -91,7 +91,7 @@ static struct conf_service *parse_service(xmlNode *node)
             if (rank)
                 md->rank = atoi(rank);
             else
-                md->rank = 1;
+                md->rank = 0;
 
             if (type)
             {
@@ -107,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)
             {
@@ -327,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"))
@@ -420,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);