=================================================================== RCS file: /cvs/mandoc/cgi.c,v retrieving revision 1.60 retrieving revision 1.62 diff -u -p -r1.60 -r1.62 --- mandoc/cgi.c 2014/07/09 17:03:07 1.60 +++ mandoc/cgi.c 2014/07/11 22:25:44 1.62 @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.60 2014/07/09 17:03:07 schwarze Exp $ */ +/* $Id: cgi.c,v 1.62 2014/07/11 22:25:44 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -314,12 +314,12 @@ resp_begin_http(int code, const char *msg) { if (200 != code) - printf("Status: %d %s\n", code, msg); + printf("Status: %d %s\r\n", code, msg); - puts("Content-Type: text/html; charset=utf-8\n" - "Cache-Control: no-cache\n" - "Pragma: no-cache\n" - ""); + printf("Content-Type: text/html; charset=utf-8\r\n" + "Cache-Control: no-cache\r\n" + "Pragma: no-cache\r\n" + "\r\n"); fflush(stdout); } @@ -367,7 +367,7 @@ resp_searchform(const struct req *req) "
\n" "Search Parameters\n" " for manuals satisfying \n" + " VALUE=\"Search\"> for manuals matching \n" "q.expr ? req->q.expr : ""); @@ -414,7 +414,10 @@ resp_index(const struct req *req) ""); resp_searchform(req); puts("

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

"); resp_end_html(); @@ -481,12 +484,13 @@ resp_search(const struct req *req, struct manpage *r, * If we have just one result, then jump there now * without any delay. */ - puts("Status: 303 See Other"); + printf("Status: 303 See Other\r\n"); printf("Location: http://%s%s/show/%s/%s?", httphost, scriptname, req->q.manpath, r[0].file); http_printquery(req); - puts("\n" - "Content-Type: text/html; charset=utf-8\n"); + printf("\r\n" + "Content-Type: text/html; charset=utf-8\r\n" + "\r\n"); return; }