=================================================================== RCS file: /cvs/mandoc/cgi.c,v retrieving revision 1.122 retrieving revision 1.123 diff -u -p -r1.122 -r1.123 --- mandoc/cgi.c 2016/04/14 23:48:48 1.122 +++ mandoc/cgi.c 2016/04/15 00:14:17 1.123 @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.122 2016/04/14 23:48:48 schwarze Exp $ */ +/* $Id: cgi.c,v 1.123 2016/04/15 00:14:17 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016 Ingo Schwarze @@ -588,34 +588,37 @@ pg_searchres(const struct req *req, struct manpage *r, resp_begin_html(200, NULL); resp_searchform(req); - puts("
"); - puts(""); - for (i = 0; i < sz; i++) { - printf("\n" - "\n" - "\n" - ""); - } + if (sz > 1) { + puts("
"); + puts("
\n" - "q.manpath, r[i].file); - printf("\">"); - html_print(r[i].names); - printf("\n" - ""); - html_print(r[i].output); - puts("
"); - puts("
\n" - "
"); + for (i = 0; i < sz; i++) { + printf("\n" + "\n" + "q.manpath, r[i].file); + printf("\">"); + html_print(r[i].names); + printf("\n" + "\n" + ""); + html_print(r[i].output); + puts("\n" + ""); + } + puts("\n" + ""); + } + /* * In man(1) mode, show one of the pages * even if more than one is found. */ - if (req->q.equal) { + if (req->q.equal || sz == 1) { puts("
"); iuse = 0; priouse = 20;