--- libaitwww/src/aitwww.c 2012/03/08 23:40:21 1.1.1.1 +++ libaitwww/src/aitwww.c 2012/03/09 09:38:55 1.1.1.1.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitwww.c,v 1.1.1.1 2012/03/08 23:40:21 misho Exp $ +* $Id: aitwww.c,v 1.1.1.1.2.1 2012/03/09 09:38:55 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -235,7 +235,7 @@ www_parseQuery(const char *str) } free(base); - return 0; + return cgi; } /* @@ -257,9 +257,9 @@ www_getValue(cgi_t * __restrict cgi, const char *name) SLIST_FOREACH(t, cgi, cgi_node) if (t->cgi_name && !strcmp(name, t->cgi_name)) - break; + return t->cgi_value; - return t->cgi_value; + return NULL; } /* @@ -307,7 +307,10 @@ www_addValue(cgi_t * __restrict cgi, const char *name, if (value) tmp->cgi_value = strdup(value); - SLIST_INSERT_AFTER(t, tmp, cgi_node); + if (!t) + SLIST_INSERT_HEAD(cgi, tmp, cgi_node); + else + SLIST_INSERT_AFTER(t, tmp, cgi_node); return 0; }