diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-04-15 00:37:50 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-04-15 00:37:50 +0000 |
commit | aabc253c10f7058df3c88983f91acceedb786ffb (patch) | |
tree | a835326d4c8bd085723d73725e1c141a21a2e8bb | |
parent | 7ccf676d918d4d24100f3b87a668afd042dc5de3 (diff) | |
download | mandoc-aabc253c10f7058df3c88983f91acceedb786ffb.tar.gz |
If PATH_INFO contains a complete and correct path to a manual page
file, for example "/OpenBSD-5.9/man2/pledge.2", no database query
is needed and the file is delivered directly.
But even in this case, let's parse the PATH_INFO and fill the query
structure such that the search form at the top of the result page
gets pre-filled with useful values.
-rw-r--r-- | cgi.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1037,9 +1037,10 @@ main(void) else if (*path == '/') path++; - if (*path != '\0' && access(path, F_OK) == -1) { + if (*path != '\0') { path_parse(&req, path); - path = ""; + if (access(path, F_OK) == -1) + path = ""; } else if ((querystring = getenv("QUERY_STRING")) != NULL) http_parse(&req, querystring); |