ZOOM: handle trailing slash for Z39.50 urls
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 17 Apr 2012 13:52:03 +0000 (15:52 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 17 Apr 2012 13:52:03 +0000 (15:52 +0200)
Previously localhost:9999/ would result in en empty database list -
which in turn would result in encoding failure for search.

src/zoom-c.c

index 0bb0b3f..e763918 100644 (file)
@@ -337,7 +337,7 @@ char **ZOOM_connection_get_databases(ZOOM_connection con, ZOOM_options options,
         if (cp)
             cp++;
     }
         if (cp)
             cp++;
     }
-    if (!cp)
+    if (!cp || !*cp)
         cp = "Default";
     nmem_strsplit(odr_getmem(odr), "+", cp,  &databaseNames, num);
     return databaseNames;
         cp = "Default";
     nmem_strsplit(odr_getmem(odr), "+", cp,  &databaseNames, num);
     return databaseNames;