=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/cgi.c,v retrieving revision 1.59 retrieving revision 1.60 diff -c -r1.59 -r1.60 *** src/usr.bin/mandoc/cgi.c 2016/04/13 12:58:13 1.59 --- src/usr.bin/mandoc/cgi.c 2016/04/14 20:38:50 1.60 *************** *** 1,4 **** ! /* $OpenBSD: cgi.c,v 1.59 2016/04/13 12:58:13 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: cgi.c,v 1.60 2016/04/14 20:38:50 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016 Ingo Schwarze *************** *** 53,58 **** --- 53,59 ---- 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,191 **** --- 187,193 ---- char *key, *val; size_t keysz, valsz; + req->isquery = 1; req->q.manpath = NULL; req->q.arch = NULL; req->q.sec = NULL; *************** *** 566,572 **** return; } ! if (1 == sz) { /* * If we have just one result, then jump there now * without any delay. --- 568,574 ---- return; } ! if (req->isquery && sz == 1) { /* * If we have just one result, then jump there now * without any delay. *************** *** 1083,1088 **** --- 1085,1091 ---- { int dir_done; + req->isquery = 0; req->q.equal = 1; req->q.manpath = mandoc_strdup(path);