multi: empty route pattern uses route as default
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 8 Mar 2012 08:53:36 +0000 (09:53 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 8 Mar 2012 08:53:36 +0000 (09:53 +0100)
That is
 <target route="z3950.indexdata.com">z3950.indexdata.com</route>
may use the shorter notation
 <target route="z3950.indexdata.com"/>

src/filter_multi.cpp

index c49825b..c05070a 100644 (file)
@@ -1295,6 +1295,8 @@ void mp::filter::Multi::configure(const xmlNode * ptr, bool test_only,
         {
             std::string route = mp::xml::get_route(ptr);
             std::string target = mp::xml::get_text(ptr);
+            if (target.length() == 0)
+                target = route;
             m_p->m_route_patterns.push_back(Multi::Map(target, route));
         }
         else if (!strcmp((const char *) ptr->name, "hideunavailable"))