From 2132ceb662c8c40046a7cea4549d173025b53981 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 18 May 2011 09:50:56 +0200 Subject: [PATCH] Move declarations in cmd_termlist --- src/http_command.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/http_command.c b/src/http_command.c index 90b6cd6..bbd6b83 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -539,9 +539,6 @@ static void cmd_termlist(struct http_channel *c) struct http_response *rs = c->response; struct http_request *rq = c->request; struct http_session *s = locate_session(c); - struct termlist_score **p; - int len; - int i; const char *name = http_argbyname(rq, "name"); const char *nums = http_argbyname(rq, "num"); int num = 15; @@ -582,10 +579,13 @@ static void cmd_termlist(struct http_channel *c) } else { - p = get_termlist_score(s->psession, tname, &len); + int len; + struct termlist_score **p = + get_termlist_score(s->psession, tname, &len); if (p && len) wrbuf_printf(debug_log, " %s: %d", tname, len); if (p) { + int i; for (i = 0; i < len && i < num; i++){ // prevnt sending empty term elements if (!p[i]->term || !p[i]->term[0]) @@ -595,7 +595,7 @@ static void cmd_termlist(struct http_channel *c) wrbuf_puts(c->wrbuf, ""); wrbuf_xmlputs(c->wrbuf, p[i]->term); wrbuf_puts(c->wrbuf, ""); - + wrbuf_printf(c->wrbuf, "%d", p[i]->frequency); -- 1.7.10.4