=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/cgi.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- src/usr.bin/mandoc/cgi.c 2016/04/15 00:51:39 1.64 +++ src/usr.bin/mandoc/cgi.c 2016/04/15 01:33:48 1.65 @@ -1,4 +1,4 @@ -/* $OpenBSD: cgi.c,v 1.64 2016/04/15 00:51:39 schwarze Exp $ */ +/* $OpenBSD: cgi.c,v 1.65 2016/04/15 01:33:48 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016 Ingo Schwarze @@ -339,14 +339,14 @@ resp_begin_http(code, msg); printf("\n" - "\n" - "\n" - "\n" - "\n" - "%s\n" - "\n" - "\n" + "\n" + "\n" + "\n" + "\n" + "%s\n" + "\n" + "\n" "\n", CSS_DIR, CUSTOMIZE_TITLE); @@ -359,8 +359,8 @@ resp_copy(MAN_DIR "/footer.html"); - puts("\n" - ""); + puts("\n" + ""); } static void @@ -369,93 +369,93 @@ int i; puts(""); - printf("
\n" - "
\n" - "
\n" - "Manual Page Search Parameters\n", + printf("
\n" + "\n" + "
\n" + "Manual Page Search Parameters\n", scriptname); /* Write query input box. */ - printf( "
\n" - "
\n" + "q.query) html_print(req->q.query); - puts("\" SIZE=\"40\">"); + puts("\" size=\"40\">"); /* Write submission and reset buttons. */ - printf( "\n" - "\n"); + printf( "\n" + "\n"); /* Write show radio button */ - printf( "\n" - "\n" + "q.equal) - printf("CHECKED=\"checked\" "); - printf( "NAME=\"apropos\" ID=\"show\" VALUE=\"0\">\n" - "\n"); + printf("checked=\"checked\" "); + printf( "name=\"apropos\" id=\"show\" value=\"0\">\n" + "\n"); /* Write section selector. */ - puts( "
\n" - "
\n" + ""); + puts(""); /* Write architecture selector. */ - printf( ""); + puts(""); /* Write manpath selector. */ if (req->psz > 1) { - puts(""); for (i = 0; i < (int)req->psz; i++) { - printf(""); + puts(""); } - puts(""); + puts(""); } /* Write search radio button */ - printf( "\n" - "\n" + "q.equal) - printf("CHECKED=\"checked\" "); - printf( "NAME=\"apropos\" ID=\"search\" VALUE=\"1\">\n" - "\n"); + printf("checked=\"checked\" "); + printf( "name=\"apropos\" id=\"search\" value=\"1\">\n" + "\n"); - puts("
\n" - "
\n" - "\n" - "
"); + puts("\n" + "
\n" + "\n" + "
"); puts(""); } @@ -505,13 +505,13 @@ resp_begin_html(200, NULL); resp_searchform(req); - printf("

\n" + printf("

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

\n", + "

\n", scriptname, *scriptname == '\0' ? "" : "/", scriptname, *scriptname == '\0' ? "" : "/"); resp_end_html(); @@ -522,9 +522,9 @@ { resp_begin_html(200, NULL); resp_searchform(req); - puts("

"); + puts("

"); puts(msg); - puts("

"); + puts("

"); resp_end_html(); } @@ -533,12 +533,12 @@ { resp_begin_html(400, "Bad Request"); - puts("

Bad Request

\n" - "

\n"); + puts("

Bad Request

\n" + "

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

", scriptname); + "main page.\n" + "

", scriptname); resp_end_html(); } @@ -546,7 +546,7 @@ pg_error_internal(void) { resp_begin_html(500, "Internal Server Error"); - puts("

Internal Server Error

"); + puts("

Internal Server Error

"); resp_end_html(); } @@ -588,27 +588,27 @@ resp_searchform(req); if (sz > 1) { - puts("
"); - puts(""); + puts("
"); + puts("
"); for (i = 0; i < sz; i++) { - printf("\n" - "\n" - "\n" + "\n" - ""); + puts("\n" + ""); } - puts("
\n" - "\n" + "\n" + "q.manpath, r[i].file); printf("\">"); html_print(r[i].names); - printf("\n" - ""); + printf("\n" + ""); html_print(r[i].output); - puts("
\n" - "
"); + puts("\n" + ""); } /* @@ -617,7 +617,7 @@ */ if (req->q.equal || sz == 1) { - puts("
"); + puts("
"); iuse = 0; priouse = 20; archpriouse = 3; @@ -668,12 +668,12 @@ int italic, bold; if ((f = fopen(file, "r")) == NULL) { - puts("

You specified an invalid manual file.

"); + puts("

You specified an invalid manual file.

"); return; } - puts("
\n" - "
");
+	puts("
\n" + "
");
 
 	p = NULL;
 	sz = 0;
@@ -699,9 +699,9 @@
 
 			if ('\b' != p[i + 1]) {
 				if (italic)
-					printf("");
+					printf("");
 				if (bold)
-					printf("");
+					printf("");
 				italic = bold = 0;
 				html_putchar(p[i]);
 				continue;
@@ -712,9 +712,9 @@
 
 			if ('_' == p[i]) {
 				if (bold)
-					printf("");
+					printf("");
 				if ( ! italic)
-					printf("");
+					printf("");
 				bold = 0;
 				italic = 1;
 				i += 2;
@@ -736,9 +736,9 @@
 					('*' == p[i] && '|' == p[i + 2]) ||
 					('|' == p[i] && '*' == p[i + 2]))  {
 				if (italic)
-					printf("");
+					printf("");
 				if (bold)
-					printf("");
+					printf("");
 				italic = bold = 0;
 				putchar('*');
 				i += 2;
@@ -750,9 +750,9 @@
 					('+' == p[i] && '|' == p[i + 1]) ||
 					('|' == p[i] && '+' == p[i + 1]))  {
 				if (italic)
-					printf("");
+					printf("");
 				if (bold)
-					printf("");
+					printf("");
 				italic = bold = 0;
 				putchar('+');
 				i += 2;
@@ -762,9 +762,9 @@
 			/* Bold mode. */
 
 			if (italic)
-				printf("");
+				printf("");
 			if ( ! bold)
-				printf("");
+				printf("");
 			bold = 1;
 			italic = 0;
 			i += 2;
@@ -777,9 +777,9 @@
 		 */
 
 		if (italic)
-			printf("");
+			printf("");
 		if (bold)
-			printf("");
+			printf("");
 
 		if (i == len - 1 && p[i] != '\n')
 			html_putchar(p[i]);
@@ -788,8 +788,8 @@
 	}
 	free(p);
 
-	puts("
\n" - "
"); + puts("
\n" + "
"); fclose(f); } @@ -805,7 +805,7 @@ int usepath; if (-1 == (fd = open(file, O_RDONLY, 0))) { - puts("

You specified an invalid manual file.

"); + puts("

You specified an invalid manual file.

"); return; }