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

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

\n", scriptname, *scriptname == '\0' ? "" : "/", scriptname, *scriptname == '\0' ? "" : "/"); resp_end_html(); --- 505,517 ---- resp_begin_html(200, NULL); resp_searchform(req); ! printf("

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

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

"); puts(msg); ! puts("

"); resp_end_html(); } --- 522,530 ---- { resp_begin_html(200, NULL); resp_searchform(req); ! puts("

"); puts(msg); ! puts("

"); resp_end_html(); } *************** *** 533,544 **** { resp_begin_html(400, "Bad Request"); ! puts("

Bad Request

\n" ! "

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

", scriptname); resp_end_html(); } --- 533,544 ---- { resp_begin_html(400, "Bad Request"); ! puts("

Bad Request

\n" ! "

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

", scriptname); resp_end_html(); } *************** *** 546,552 **** pg_error_internal(void) { resp_begin_html(500, "Internal Server Error"); ! puts("

Internal Server Error

"); resp_end_html(); } --- 546,552 ---- pg_error_internal(void) { resp_begin_html(500, "Internal Server Error"); ! puts("

Internal Server Error

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

You specified an invalid manual file.

"); return; } ! puts("
\n" ! "
");
  
  	p = NULL;
  	sz = 0;
--- 668,679 ----
  	int		 italic, bold;
  
  	if ((f = fopen(file, "r")) == NULL) {
! 		puts("

You specified an invalid manual file.

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

You specified an invalid manual file.

"); return; } --- 805,811 ---- int usepath; if (-1 == (fd = open(file, O_RDONLY, 0))) { ! puts("

You specified an invalid manual file.

"); return; }