From 1e8adcca70828544df65770652d86e7d828a5795 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 19 Oct 2011 19:02:51 +0200 Subject: [PATCH] Change termlist result to include also empty lists This makes it behave like previous release 1.6.3. --- src/session.c | 14 ++++++-------- test/test_facets_11.res | 2 ++ test/test_facets_14.res | 2 ++ test/test_facets_17.res | 2 ++ test/test_facets_18.res | 2 ++ test/test_facets_24.res | 2 ++ test/test_facets_6.res | 2 ++ 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/session.c b/src/session.c index 1be728f..388e94e 100644 --- a/src/session.c +++ b/src/session.c @@ -1045,6 +1045,11 @@ void perform_termlist(struct http_channel *c, struct session *se, for (j = 0; j < num_names; j++) { const char *tname; + + wrbuf_puts(c->wrbuf, "wrbuf, names[j]); + wrbuf_puts(c->wrbuf, "\">\n"); + for (i = 0; i < se->num_termlists; i++) { tname = se->termlists[i].name; @@ -1056,9 +1061,6 @@ void perform_termlist(struct http_channel *c, struct session *se, if (p) { int i; - wrbuf_puts(c->wrbuf, "wrbuf, tname); - wrbuf_puts(c->wrbuf, "\">\n"); for (i = 0; i < len && i < num; i++) { // prevent sending empty term elements @@ -1075,19 +1077,15 @@ void perform_termlist(struct http_channel *c, struct session *se, p[i]->frequency); wrbuf_puts(c->wrbuf, "\n"); } - wrbuf_puts(c->wrbuf, "\n"); } } } tname = "xtargets"; if (num_names > 0 && !strcmp(names[j], tname)) { - wrbuf_puts(c->wrbuf, "wrbuf, tname); - wrbuf_puts(c->wrbuf, "\">\n"); targets_termlist_nb(c->wrbuf, se, num, c->nmem); - wrbuf_puts(c->wrbuf, "\n"); } + wrbuf_puts(c->wrbuf, "\n"); } session_leave(se); nmem_destroy(nmem_tmp); diff --git a/test/test_facets_11.res b/test/test_facets_11.res index 6045d02..aaf0155 100644 --- a/test/test_facets_11.res +++ b/test/test_facets_11.res @@ -45,4 +45,6 @@ date820 date910 + + \ No newline at end of file diff --git a/test/test_facets_14.res b/test/test_facets_14.res index f750176..37b5a75 100644 --- a/test/test_facets_14.res +++ b/test/test_facets_14.res @@ -45,4 +45,6 @@ date820 date910 + + \ No newline at end of file diff --git a/test/test_facets_17.res b/test/test_facets_17.res index 7765713..00e11f8 100644 --- a/test/test_facets_17.res +++ b/test/test_facets_17.res @@ -45,4 +45,6 @@ date820 date910 + + \ No newline at end of file diff --git a/test/test_facets_18.res b/test/test_facets_18.res index 7765713..00e11f8 100644 --- a/test/test_facets_18.res +++ b/test/test_facets_18.res @@ -45,4 +45,6 @@ date820 date910 + + \ No newline at end of file diff --git a/test/test_facets_24.res b/test/test_facets_24.res index 512b81f..598b204 100644 --- a/test/test_facets_24.res +++ b/test/test_facets_24.res @@ -40,4 +40,6 @@ date820 date910 + + \ No newline at end of file diff --git a/test/test_facets_6.res b/test/test_facets_6.res index f78c7dc..ebb8bb4 100644 --- a/test/test_facets_6.res +++ b/test/test_facets_6.res @@ -30,4 +30,6 @@ 19731 19801 + + \ No newline at end of file -- 1.7.10.4