summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/cgi.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-07-13 15:38:06 +0000
committerschwarze <schwarze@openbsd.org>2014-07-13 15:38:06 +0000
commitaabcc9a1cf92b664532a1e7cb2103ad7b0a35f11 (patch)
tree06f6a7d5dc1cafae1cad6d9ff42cfefc5da90ee1 /usr.bin/mandoc/cgi.c
parentFall back to smaller spacing on the mips64 machines. (diff)
downloadwireguard-openbsd-aabcc9a1cf92b664532a1e7cb2103ad7b0a35f11.tar.xz
wireguard-openbsd-aabcc9a1cf92b664532a1e7cb2103ad7b0a35f11.zip
Compatibility hack for the old "manpath=OpenBSD<blank>" query parameter format;
unfortunate, more than 400 links needing this are scattered all around the www.openbsd.org website, and CVSweb needs this as well.
Diffstat (limited to 'usr.bin/mandoc/cgi.c')
-rw-r--r--usr.bin/mandoc/cgi.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c
index 6d2dba2eeea..24bcb3e795c 100644
--- a/usr.bin/mandoc/cgi.c
+++ b/usr.bin/mandoc/cgi.c
@@ -1,4 +1,4 @@
-/* $Id: cgi.c,v 1.12 2014/07/13 12:55:24 schwarze Exp $ */
+/* $Id: cgi.c,v 1.13 2014/07/13 15:38:06 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@usta.de>
@@ -246,14 +246,25 @@ http_parse(struct req *req, char *p)
if (0 == strcmp(key, "query"))
req->q.expr = val;
- else if (0 == strcmp(key, "manpath"))
+ else if (0 == strcmp(key, "manpath")) {
+#ifdef COMPAT_OLDURI
+ if (0 == strncmp(val, "OpenBSD ", 8)) {
+ val[7] = '-';
+ if ('C' == val[8])
+ val[8] = 'c';
+ }
+#endif
req->q.manpath = val;
- else if (0 == strcmp(key, "apropos"))
+ } else if (0 == strcmp(key, "apropos"))
req->q.equal = !strcmp(val, "0");
- else if (0 == strcmp(key, "sec") ||
- 0 == strcmp(key, "sektion")) {
+ else if (0 == strcmp(key, "sec")) {
+ if (strcmp(val, "0"))
+ req->q.sec = val;
+#ifdef COMPAT_OLDURI
+ } else if (0 == strcmp(key, "sektion")) {
if (strcmp(val, "0"))
req->q.sec = val;
+#endif
} else if (0 == strcmp(key, "arch")) {
if (strcmp(val, "default"))
req->q.arch = val;