summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-04-14 20:40:33 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-04-14 20:40:33 +0000
commit40f9d07df6c58b501364e4213d7b74b3305da7ee (patch)
treee7b283153b4b63429859d8793f74bd0ae0cad969
parent6e84df2c172eaa4ca3bb5c98c3f7c9b1d5517029 (diff)
downloadmandoc-40f9d07df6c58b501364e4213d7b74b3305da7ee.tar.gz
do not rewrite short queries
-rw-r--r--cgi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cgi.c b/cgi.c
index b4982d75..b7773679 100644
--- a/cgi.c
+++ b/cgi.c
@@ -55,6 +55,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 *);
@@ -188,6 +189,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;
@@ -568,7 +570,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.
@@ -1085,6 +1087,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);