summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteuf <teuf@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2008-10-07 18:57:06 +0000
committerteuf <teuf@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2008-10-07 18:57:06 +0000
commitb17ab2ab37c011d31bedf2528ce95023c41700fd (patch)
treee4c89d988b4b2ee0b9c7f0db2d94bae09a11e946
parentd15ac949b5c12e39a0acaaa3bba917aa2866e975 (diff)
downloadlibgpod-b17ab2ab37c011d31bedf2528ce95023c41700fd.tar.gz
libgpod-b17ab2ab37c011d31bedf2528ce95023c41700fd.tar.xz
libgpod-b17ab2ab37c011d31bedf2528ce95023c41700fd.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
-rw-r--r--ChangeLog6
-rw-r--r--src/itdb_plist.c14
2 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index e0fb880..32159f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2008-10-07 Christophe Fergeau <teuf@gnome.org>
+ * src/itdb_plist.c: fix handling on blank nodes (ie nodes
+ containing only white spaces), fixes parsing of SysInfoExtended files
+ as well ;)
+
+2008-10-07 Christophe Fergeau <teuf@gnome.org>
+
* src/itdb_plist.c: add support for <array> tags to the plist
parser, this is needed to support SysInfoExtended files as found on
on the 4g nanos
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) {