Another diff. HTTP headers have to be separated by CRLF.

Index: cgi.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/cgi.c,v
retrieving revision 1.1
diff -u -p -r1.1 cgi.c
--- cgi.c       11 Jul 2014 15:37:22 -0000      1.1
+++ cgi.c       11 Jul 2014 16:00:56 -0000
@@ -310,12 +310,12 @@ resp_begin_http(int code, const char *ms
 {
 
        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);
 }
@@ -480,12 +480,13 @@ resp_search(const struct req *req, struc
                 * 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;
        }
 

Reply via email to