Release 1.6.4
[yazpp-moved-to-github.git] / src / yaz-ir-assoc.cpp
index c40ebda..a681bf0 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the yazpp toolkit.
- * Copyright (C) 1998-2012 Index Data and Mike Taylor
+ * Copyright (C) Index Data 
  * See the file LICENSE for details.
  */
 
@@ -11,6 +11,7 @@
 #include <yaz/log.h>
 #include <yazpp/ir-assoc.h>
 #include <yaz/oid_db.h>
+#include <yaz/comstack.h>
 
 using namespace yazpp_1;
 
@@ -302,9 +303,10 @@ void IR_Assoc::client(const char *addr)
     delete [] m_host;
     m_host = new char[strlen(addr)+1];
     strcpy(m_host, addr);
-    const char *dbpart = strchr(m_host, '/');
-    if (dbpart)
-        set_databaseNames (dbpart+1, "+ ");
+    const char *dbpart = 0;
+    cs_get_host_args(m_host, &dbpart);
+    if (dbpart && *dbpart)
+        set_databaseNames (dbpart, "+ ");
     Z_Assoc::client(m_proxy ? m_proxy : m_host);
 }