mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-27 18:50:07 +03:00
tree: Fix handling of empty strings in xmlNodeParseContent
We shouldn't create an empty text node to match the old behavior. Fixes #759.
This commit is contained in:
parent
46ec621eb7
commit
944cc23c84
16
testparser.c
16
testparser.c
@ -13,6 +13,21 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
static int
|
||||
testNewDocNode(void) {
|
||||
xmlNodePtr node;
|
||||
int err = 0;
|
||||
|
||||
node = xmlNewDocNode(NULL, NULL, BAD_CAST "c", BAD_CAST "");
|
||||
if (node->children != NULL) {
|
||||
fprintf(stderr, "empty node has children\n");
|
||||
err = 1;
|
||||
}
|
||||
xmlFreeNode(node);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
testStandaloneWithEncoding(void) {
|
||||
xmlDocPtr doc;
|
||||
@ -631,6 +646,7 @@ int
|
||||
main(void) {
|
||||
int err = 0;
|
||||
|
||||
err |= testNewDocNode();
|
||||
err |= testStandaloneWithEncoding();
|
||||
err |= testUnsupportedEncoding();
|
||||
err |= testNodeGetContent();
|
||||
|
Loading…
x
Reference in New Issue
Block a user