From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 11bd203b for ; Thu, 14 Apr 2016 19:38:20 -0500 (EST) Date: Thu, 14 Apr 2016 19:38:20 -0500 (EST) Message-Id: <2701745593245970176.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: If PATH_INFO contains a complete and correct path to a manual X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- 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. Modified Files: -------------- mdocml: cgi.c Revision Data ------------- Index: cgi.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/cgi.c,v retrieving revision 1.123 retrieving revision 1.124 diff -Lcgi.c -Lcgi.c -u -p -r1.123 -r1.124 --- cgi.c +++ cgi.c @@ -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); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv