=================================================================== RCS file: /cvs/mandoc/cgi.c,v retrieving revision 1.176 retrieving revision 1.177 diff -u -p -r1.176 -r1.177 --- mandoc/cgi.c 2021/11/05 17:04:10 1.176 +++ mandoc/cgi.c 2022/07/04 16:20:42 1.177 @@ -1,7 +1,8 @@ -/* $Id: cgi.c,v 1.176 2021/11/05 17:04:10 schwarze Exp $ */ +/* $Id: cgi.c,v 1.177 2022/07/04 16:20:42 schwarze Exp $ */ /* * Copyright (c) 2014-2019, 2021 Ingo Schwarze * Copyright (c) 2011, 2012 Kristaps Dzonsons + * Copyright (c) 2022 Anna Vyalkova * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -431,7 +432,8 @@ resp_searchform(const struct req *req, enum focus focu { int i; - printf("
\n" + "\n" "
\n" " Manual Page Search Parameters\n", @@ -457,7 +459,7 @@ resp_searchform(const struct req *req, enum focus focu /* Write section selector. */ - puts(" "); for (i = 0; i < sec_MAX; i++) { printf("
\n" - "
"); + "\n" + ""); } static int @@ -557,13 +560,17 @@ pg_index(const struct req *req) resp_begin_html(200, NULL, NULL); resp_searchform(req, FOCUS_QUERY); - printf("

\n" + printf("

\n" + "

\n" "This web interface is documented in the\n" - "man.cgi(8)\n" + "man.cgi(8)\n" "manual, and the\n" - "apropos(1)\n" + "apropos(1)\n" "manual explains the query syntax.\n" - "

\n", + "

\n" + "
\n", scriptname, *scriptname == '\0' ? "" : "/", scriptname, *scriptname == '\0' ? "" : "/"); resp_end_html(); @@ -575,9 +582,11 @@ pg_noresult(const struct req *req, int code, const cha { resp_begin_html(code, http_msg, NULL); resp_searchform(req, FOCUS_QUERY); - puts("

"); + puts("

"); + puts("

"); puts(user_msg); puts("

"); + puts("
"); resp_end_html(); } @@ -586,12 +595,14 @@ pg_error_badrequest(const char *msg) { resp_begin_html(400, "Bad Request", NULL); - puts("

Bad Request

\n" - "

\n"); + puts("

\n" + "

Bad Request

\n" + "

"); puts(msg); printf("Try again from the\n" "main page.\n" - "

", scriptname); + "

\n" + "
", scriptname); resp_end_html(); } @@ -599,7 +610,7 @@ static void pg_error_internal(void) { resp_begin_html(500, "Internal Server Error", NULL); - puts("

Internal Server Error

"); + puts("

Internal Server Error

"); resp_end_html(); } @@ -704,6 +715,7 @@ pg_searchres(const struct req *req, struct manpage *r, req->q.equal || sz == 1 ? FOCUS_NONE : FOCUS_QUERY); if (sz > 1) { + puts(""); } if (req->q.equal || sz == 1) { @@ -743,7 +756,9 @@ resp_catman(const struct req *req, const char *file) int italic, bold; if ((f = fopen(file, "r")) == NULL) { - puts("

You specified an invalid manual file.

"); + puts("

\n" + " You specified an invalid manual file.\n" + "

"); return; } @@ -880,7 +895,9 @@ resp_format(const struct req *req, const char *file) int usepath; if (-1 == (fd = open(file, O_RDONLY))) { - puts("

You specified an invalid manual file.

"); + puts("

\n" + " You specified an invalid manual file.\n" + "

"); return; }