Cleaning up

This commit is contained in:
Tristan Roux
2019-12-06 14:04:28 +01:00
parent d3ee7dca52
commit fc29dbf9d5

View File

@@ -44,11 +44,9 @@ node *xml_parsestr(char *nodestr)
if (xml_handle_prolog(&nodestr) < 0) if (xml_handle_prolog(&nodestr) < 0)
return (NULL); return (NULL);
for (int i = 0; nodestr[i]; i++) { for (int i = 0; nodestr[i]; i++) {
if (nodestr[i] == ' ') { if (nodestr[i] == ' ' && !is_space_usefull(nodestr, i))
if (!is_space_usefull(nodestr, i))
nodestr[i] = '\t'; nodestr[i] = '\t';
} }
}
for (int i = 0; nodestr[i]; i++) { for (int i = 0; nodestr[i]; i++) {
if (nodestr[i] == '\t' || nodestr[i] == '\n' || nodestr[i] == '\r') { if (nodestr[i] == '\t' || nodestr[i] == '\n' || nodestr[i] == '\r') {
nodestr[i] = nodestr[i + 1]; nodestr[i] = nodestr[i + 1];