diff options
| author | Christophe Fergeau <teuf@gnome.org> | 2008-10-07 18:57:06 +0000 |
|---|---|---|
| committer | Christophe Fergeau <teuf@gnome.org> | 2008-10-07 18:57:06 +0000 |
| commit | 51a1f6b442aa07a6d4deb5312331bf1866d43c94 (patch) | |
| tree | e4c89d988b4b2ee0b9c7f0db2d94bae09a11e946 /src | |
| parent | f082ce290051e2153f5fd269cf017b2ec83ba8f9 (diff) | |
| download | libgpod-51a1f6b442aa07a6d4deb5312331bf1866d43c94.tar.gz libgpod-51a1f6b442aa07a6d4deb5312331bf1866d43c94.tar.xz libgpod-51a1f6b442aa07a6d4deb5312331bf1866d43c94.zip | |
Fix blank node handling in the plist parser
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2136 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src')
| -rw-r--r-- | src/itdb_plist.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/itdb_plist.c b/src/itdb_plist.c index a0ea8f4..00e2b4b 100644 --- a/src/itdb_plist.c +++ b/src/itdb_plist.c @@ -197,7 +197,7 @@ parse_one_dict_entry (xmlNode *a_node, GHashTable *dict, GError **error) GValue *value; while ((cur_node != NULL) && (xmlStrcmp(cur_node->name, (xmlChar *)"key") != 0)) { - if (!xmlNodeIsText (cur_node)) { + if (!xmlIsBlankNode (cur_node)) { DEBUG ("skipping %s\n", cur_node->name); } cur_node = cur_node->next; @@ -207,9 +207,9 @@ parse_one_dict_entry (xmlNode *a_node, GHashTable *dict, GError **error) "Dict entry contains no <key> node"); return NULL; } - key_name = xmlNodeGetContent(cur_node); + key_name = xmlNodeGetContent (cur_node); cur_node = cur_node->next; - while ((cur_node != NULL) && xmlNodeIsText(cur_node)) { + while ((cur_node != NULL) && xmlIsBlankNode (cur_node)) { cur_node = cur_node->next; } if (cur_node == NULL) { @@ -243,7 +243,11 @@ parse_dict (xmlNode *a_node, GError **error) g_free, (GDestroyNotify)value_free); while (cur_node != NULL) { - cur_node = parse_one_dict_entry (cur_node, dict, error); + if (xmlIsBlankNode (cur_node)) { + cur_node = cur_node->next; + } else { + cur_node = parse_one_dict_entry (cur_node, dict, error); + } } if ((error != NULL) && (*error != NULL)) { g_hash_table_destroy (dict); @@ -356,7 +360,7 @@ itdb_plist_parse (xmlNode * a_node, GError **error) return NULL; } cur_node = a_node->xmlChildrenNode; - while ((cur_node != NULL) && (xmlNodeIsText (cur_node))) { + while ((cur_node != NULL) && (xmlIsBlankNode (cur_node))) { cur_node = cur_node->next; } if (cur_node != NULL) { |
