From ae4c58aed893d63173fe94d502a8d7d28ec8003f Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 4 Jul 2022 16:20:42 +0000 Subject: Improve accessibility of man.cgi(8) in various respects, in particular adding
,
, and
"); } 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 char *http_msg, { 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, size_t sz) 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; } -- cgit v1.2.3-56-ge451