From aa4dd1addbbeb1de586000a447b520e192493932 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 20 Nov 2006 21:34:53 +0000 Subject: [PATCH] foo should mean the same thing as * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_type) (soup_xmlrpc_value_get_string): foo should mean the same thing as foo. Pointed out by Todd Kulesza. #364490 --- ChangeLog | 7 +++++++ libsoup/soup-xmlrpc-response.c | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a0d0ee..a22b1f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-11-20 Dan Winship + + * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_type) + (soup_xmlrpc_value_get_string): foo should mean the + same thing as foo. Pointed out by + Todd Kulesza. #364490 + 2006-11-06 Dan Winship * configure.in: Bump version to 2.2.97. Bump AGE and CURRENT for diff --git a/libsoup/soup-xmlrpc-response.c b/libsoup/soup-xmlrpc-response.c index 1154c2b..84dabf0 100644 --- a/libsoup/soup-xmlrpc-response.c +++ b/libsoup/soup-xmlrpc-response.c @@ -203,6 +203,11 @@ soup_xmlrpc_value_get_type (SoupXmlrpcValue *value) if (!xml) return SOUP_XMLRPC_VALUE_TYPE_BAD; + if (xml->type == XML_TEXT_NODE) + return SOUP_XMLRPC_VALUE_TYPE_STRING; + else if (xml->type != XML_ELEMENT_NODE) + return SOUP_XMLRPC_VALUE_TYPE_BAD; + if (strcmp ((const char *)xml->name, "i4") == 0 || strcmp ((const char *)xml->name, "int") == 0) return SOUP_XMLRPC_VALUE_TYPE_INT; else if (strcmp ((const char *)xml->name, "boolean") == 0) @@ -310,9 +315,14 @@ soup_xmlrpc_value_get_string (SoupXmlrpcValue *value, char **str) if (strcmp ((const char *)xml->name, "value")) return FALSE; xml = exactly_one_child (xml); - if (!xml || strcmp ((const char *)xml->name, "string")) + if (!xml) return FALSE; - + if (xml->type == XML_ELEMENT_NODE) { + if (strcmp ((char *)xml->name, "string")) + return FALSE; + } else if (xml->type != XML_TEXT_NODE) + return FALSE; + content = xmlNodeGetContent (xml); *str = content ? g_strdup ((char *)content) : g_strdup (""); xmlFree (content); -- 2.7.4