Suround by suggestions, if data in suggestions_xml
authorDennis Schafroth <dennis@indexdata.com>
Tue, 1 Nov 2011 12:30:21 +0000 (13:30 +0100)
committerDennis Schafroth <dennis@indexdata.com>
Tue, 1 Nov 2011 12:30:21 +0000 (13:30 +0100)
src/http_command.c

index 587c908..a86aabb 100644 (file)
@@ -642,8 +642,11 @@ static void cmd_bytarget(struct http_channel *c)
             wrbuf_puts(c->wrbuf, ht[i].settings_xml);
             wrbuf_puts(c->wrbuf, "</settings>\n");
         }
-        if (ht[i].suggestions_xml)
+        if (ht[i].suggestions_xml && ht[i].suggestions_xml[0]) {
+            wrbuf_puts(c->wrbuf, "<suggestions>");
             wrbuf_puts(c->wrbuf, ht[i].suggestions_xml);
+            wrbuf_puts(c->wrbuf, "</suggestions>");
+        }
         wrbuf_puts(c->wrbuf, "</target>");
     }
     response_close(c, "bytarget");