mirror of
https://github.com/zoriya/xmlParser.git
synced 2025-12-06 02:56:10 +00:00
Solivng a fatal bug with unmatched quotes on the last param
This commit is contained in:
@@ -16,5 +16,5 @@ char *trimstr(char *str);
|
||||
int xml_getstringdata(node *n, char **nodestr);
|
||||
int xml_checkclosing(node *n, char **nodestr);
|
||||
dictionary *property_add(dictionary *list, dictionary *property);
|
||||
node *xml_parsenode(char **nodestr);
|
||||
node *xml_parsenode(char **str);
|
||||
int get_int_size(int n);
|
||||
@@ -74,25 +74,25 @@ node *xml_parseproperties(node *n, char **str, bool has_params, bool has_childs)
|
||||
return (n);
|
||||
}
|
||||
|
||||
node *xml_parsenode(char **nodestr)
|
||||
node *xml_parsenode(char **str)
|
||||
{
|
||||
node *n = malloc(sizeof(node));
|
||||
bool has_param;
|
||||
bool has_childs;
|
||||
char *p = my_strchr(*nodestr, '>');
|
||||
char *p = my_strchr(*str, '>');
|
||||
|
||||
if (!n)
|
||||
return (NULL);
|
||||
if ((*nodestr)[0] == '<') {
|
||||
if (p && (*nodestr)[1] != '/') {
|
||||
if ((*str)[0] == '<') {
|
||||
if (p && (*str)[1] != '/') {
|
||||
*p = '\0';
|
||||
*nodestr += 1;
|
||||
n->name = xml_getname(nodestr, &has_param, &has_childs);
|
||||
*str += 1;
|
||||
n->name = xml_getname(str, &has_param, &has_childs);
|
||||
if (n->name)
|
||||
return (xml_parseproperties(n, nodestr, has_param, has_childs));
|
||||
return (xml_parseproperties(n, str, has_param, has_childs));
|
||||
}
|
||||
} else if ((*nodestr)[1] != '/' && xml_getstringdata(n, nodestr) == 0) {
|
||||
n->next = xml_parsenode(nodestr);
|
||||
} else if (**str && (*str)[1] != '/' && !xml_getstringdata(n, str)) {
|
||||
n->next = xml_parsenode(str);
|
||||
return (n);
|
||||
}
|
||||
free(n);
|
||||
|
||||
Reference in New Issue
Block a user