=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/cgi.c,v retrieving revision 1.115 retrieving revision 1.116 diff -u -r1.115 -r1.116 --- src/usr.bin/mandoc/cgi.c 2021/10/24 21:24:16 1.115 +++ src/usr.bin/mandoc/cgi.c 2022/07/04 16:20:09 1.116 @@ -1,7 +1,8 @@ -/* $OpenBSD: cgi.c,v 1.115 2021/10/24 21:24:16 deraadt Exp $ */ +/* $OpenBSD: cgi.c,v 1.116 2022/07/04 16:20:09 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 @@ -427,7 +428,8 @@ { int i; - printf("
\n" + "\n" "
\n" " Manual Page Search Parameters\n", @@ -453,7 +455,7 @@ /* Write section selector. */ - puts(" "); for (i = 0; i < sec_MAX; i++) { printf("
\n" - "
"); + "\n" + ""); } static int @@ -553,13 +556,17 @@ 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(); @@ -571,9 +578,11 @@ { resp_begin_html(code, http_msg, NULL); resp_searchform(req, FOCUS_QUERY); - puts("

"); + puts("

"); + puts("

"); puts(user_msg); puts("

"); + puts("
"); resp_end_html(); } @@ -582,12 +591,14 @@ { 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(); } @@ -595,7 +606,7 @@ pg_error_internal(void) { resp_begin_html(500, "Internal Server Error", NULL); - puts("

Internal Server Error

"); + puts("

Internal Server Error

"); resp_end_html(); } @@ -700,6 +711,7 @@ req->q.equal || sz == 1 ? FOCUS_NONE : FOCUS_QUERY); if (sz > 1) { + puts(""); } if (req->q.equal || sz == 1) { @@ -739,7 +752,9 @@ 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; } @@ -876,7 +891,9 @@ 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; }