From a723f03473df54cccbce739fdda9b7d35da84ceb Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 7 Dec 2011 11:52:36 +0000 Subject: By default, man.cgi should compile with -static (this was unset by mistake). Also, set a custom CSS for man.cgi catman files. --- Makefile | 2 +- cgi.c | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e6f8f2a3..338a4bbe 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ CFLAGS += -DUSE_WCHAR #CFLAGS += -DUSE_MANPATH # If your system supports static binaries only, uncomment this. -#STATIC = -static +STATIC = -static CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\"" CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings diff --git a/cgi.c b/cgi.c index 17bc6ad7..416197be 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.10 2011/12/07 00:23:04 kristaps Exp $ */ +/* $Id: cgi.c,v 1.11 2011/12/07 11:52:36 kristaps Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * @@ -423,7 +423,21 @@ resp_search(struct res *r, size_t sz, void *arg) return; } - resp_begin_html(200, NULL); + resp_begin_http(200, NULL); + puts("" "\n" + "" "\n" + " " "\n" + " " "\n" + " " "\n" + " System Manpage Reference" "\n" + " " "\n" + " " "\n" + ""); + resp_searchform((const struct req *)arg); if (0 == sz) @@ -614,9 +628,9 @@ format(const char *file) return; } - snprintf(opts, sizeof(opts), "style=/style.css," + snprintf(opts, sizeof(opts), "style=/man.css," "man=%s/search.html?sec=%%S&expr=%%N," - "includes=/cgi-bin/man.cgi/usr/include/%%I", + /*"includes=/cgi-bin/man.cgi/usr/include/%%I"*/, progname); mparse_result(mp, &mdoc, &man); -- cgit v1.2.3