Revision: 2136
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2136&view=rev
Author: teuf
Date: 2008-10-07 18:57:06 +0000 (Tue, 07 Oct 2008)
Log Message:
-----------
Fix blank node handling in the plist parser
Modified Paths:
--------------
libgpod/trunk/ChangeLog
libgpod/trunk/src/itdb_plist.c
Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog 2008-10-07 18:56:51 UTC (rev 2135)
+++ libgpod/trunk/ChangeLog 2008-10-07 18:57:06 UTC (rev 2136)
@@ -1,5 +1,11 @@
2008-10-07 Christophe Fergeau <[EMAIL PROTECTED]>
+ * 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 <[EMAIL PROTECTED]>
+
* 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
Modified: libgpod/trunk/src/itdb_plist.c
===================================================================
--- libgpod/trunk/src/itdb_plist.c 2008-10-07 18:56:51 UTC (rev 2135)
+++ libgpod/trunk/src/itdb_plist.c 2008-10-07 18:57:06 UTC (rev 2136)
@@ -197,7 +197,7 @@
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 @@
"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 @@
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 @@
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) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2