summaryrefslogtreecommitdiffstats
path: root/cgi.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-07-13 15:38:36 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-07-13 15:38:36 +0000
commit220e4280121438a1e183a70d29be33f27c9dcae1 (patch)
treedf57e106d91b62afe1c0675598d14869cc69debb /cgi.c
parentf97efd4d81dc5dfc1a156e495e1ef24c906403a5 (diff)
downloadmandoc-220e4280121438a1e183a70d29be33f27c9dcae1.tar.gz
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 'cgi.c')
-rw-r--r--cgi.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/cgi.c b/cgi.c
index 23e3eb41..6430ba63 100644
--- a/cgi.c
+++ b/cgi.c
@@ -250,14 +250,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;