--- libaitio/src/Attic/url.c 2010/09/27 16:08:37 1.3.6.1 +++ libaitio/src/Attic/url.c 2011/03/16 16:44:52 1.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: url.c,v 1.3.6.1 2010/09/27 16:08:37 misho Exp $ +* $Id: url.c,v 1.5 2011/03/16 16:44:52 misho Exp $ * *************************************************************************/ #include "global.h" @@ -138,7 +138,7 @@ io_MakeArray(char * __restrict psArgs, const char *csD } else memset(*args, 0, sizeof(char*) * nargs); - for (i = 0, app = *args; app < *args + nargs && (*app = strsep(&psArgs, csDelim)); + for (i = 0, app = *args; app < *args + nargs && (*app = strsep((char **) &psArgs, csDelim)); **app ? i++ : i, **app ? app++ : app); return i; } @@ -338,18 +338,31 @@ ioXMLGet(const char *csXML, struct tagReqXML *xml) *pos++ = 0; } else pos = (char*) xml->xml_line; + // if container is path + if (*pos == '/') { + xml->xml_node.path.value = pos; + xml->xml_node.path.vallen = strlen(pos); + if (!xml->xml_node.path.vallen) + ret = 0; + else + ret |= 32; + return ret; + } else { // container - xml->xml_container.value = pos; - xml->xml_container.vallen = strlen(pos); - if (xml->xml_container.vallen) - ret |= 2; + xml->xml_node.container.value = pos; + xml->xml_node.container.vallen = strlen(pos); + if (!xml->xml_node.container.vallen) + return 0; + else + ret |= 2; + } end = strchr(pos, '?'); // if attribute present if (pos && (p = strchr(pos, '|')) && (!end || end > p)) { pos = p; *pos++ = 0; - xml->xml_container.vallen = strlen(xml->xml_container.value); - if (!xml->xml_container.vallen) + xml->xml_node.container.vallen = strlen(xml->xml_node.container.value); + if (!xml->xml_node.container.vallen) return 0; xml->xml_attribute.value = pos; @@ -389,8 +402,8 @@ ioXMLGet(const char *csXML, struct tagReqXML *xml) if (!xml->xml_attribute.vallen) return 0; } else if (ret & 2) { - xml->xml_container.vallen = strlen(xml->xml_container.value); - if (!xml->xml_container.vallen) + xml->xml_node.container.vallen = strlen(xml->xml_node.container.value); + if (!xml->xml_node.container.vallen) return 0; } else return 0;