summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2016-04-14 20:38:51 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2016-04-14 20:38:51 +0000
commit4a2a7737fca5b3c27b3a9cb329189f803fdf968f (patch)
treefec85003c2a05c81e0ad4de826e84e1ce06ffbaa /usr.bin
parent2611bc8c275e3a746b1f50a605f18b14c8dc3dfe (diff)
do not rewrite short URIs
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/cgi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c
index 668892dde54..aa6f6d0a3b2 100644
--- a/usr.bin/mandoc/cgi.c
+++ b/usr.bin/mandoc/cgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgi.c,v 1.59 2016/04/13 12:58:13 schwarze Exp $ */
+/* $OpenBSD: cgi.c,v 1.60 2016/04/14 20:38:50 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@usta.de>
@@ -53,6 +53,7 @@ struct req {
struct query q;
char **p; /* array of available manpaths */
size_t psz; /* number of available manpaths */
+ int isquery; /* QUERY_STRING used, not PATH_INFO */
};
static void catman(const struct req *, const char *);
@@ -186,6 +187,7 @@ http_parse(struct req *req, const char *qs)
char *key, *val;
size_t keysz, valsz;
+ req->isquery = 1;
req->q.manpath = NULL;
req->q.arch = NULL;
req->q.sec = NULL;
@@ -566,7 +568,7 @@ pg_searchres(const struct req *req, struct manpage *r, size_t sz)
return;
}
- if (1 == sz) {
+ if (req->isquery && sz == 1) {
/*
* If we have just one result, then jump there now
* without any delay.
@@ -1083,6 +1085,7 @@ path_parse(struct req *req, const char *path)
{
int dir_done;
+ req->isquery = 0;
req->q.equal = 1;
req->q.manpath = mandoc_strdup(path);