From 86dd4bfde2e51c5389135a45d29a98032ca0ac69 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Fri, 28 Oct 2011 13:57:07 +0200 Subject: [PATCH] Fix: usage of wrong xml node. Fix string compare. Cosmetic: add newline after xml element misspelled --- src/solr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/solr.c b/src/solr.c index d3e9c11..60df651 100644 --- a/src/solr.c +++ b/src/solr.c @@ -204,13 +204,13 @@ static int yaz_solr_decode_facet_counts(ODR o, xmlNodePtr root, return 0; } -static void yaz_solr_decode_suggestion_values(xmlNodePtr ptr, WRBUF wrbuf) +static void yaz_solr_decode_suggestion_values(xmlNodePtr listPptr, WRBUF wrbuf) { xmlNodePtr node; - for (node = ptr; node; node= node->next) { - if (!strcmp((char*)ptr->name, "lst")) { + for (node = listPptr; node; node= node->next) { + if (!strcmp((char*) node->name, "lst")) { xmlNodePtr child; - for (child = ptr->children; child; child= child->next) { + for (child = node->children; child; child= child->next) { if (match_xml_node_attribute(child, "str", "name", "word")) { wrbuf_puts(wrbuf, ""); extract_text_node(child, wrbuf); @@ -236,10 +236,10 @@ static void yaz_solr_decode_misspelled(xmlNodePtr lstPtr, WRBUF wrbuf) xmlNodePtr node; for (node = lstPtr; node; node= node->next) { - if (strcmp((const char*) node->name, "lst")) { + if (!strcmp((const char*) node->name, "lst")) { const char *misspelled = yaz_element_attribute_value_get(node, "lst", "name"); if (misspelled) { - wrbuf_printf(wrbuf, "", misspelled); + wrbuf_printf(wrbuf, "\n", misspelled); yaz_solr_decode_suggestion_lst(node->children, wrbuf); wrbuf_puts(wrbuf, "\n"); } -- 1.7.10.4