From 54ae5bad68aa6c3d014c8ecdb59a4fbbaa3fe3fd Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 26 Nov 2014 17:55:27 +0000 Subject: Make the code sipler and more robust by always assigning a value to q.manpath and dropping the (incomplete) later NULL checks. --- cgi.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/cgi.c b/cgi.c index 5b17026a..8d6c7683 100644 --- a/cgi.c +++ b/cgi.c @@ -163,8 +163,7 @@ http_printquery(const struct req *req, const char *sep) printf("%sarch=", sep); http_print(req->q.arch); } - if (NULL != req->q.manpath && - strcmp(req->q.manpath, req->p[0])) { + if (strcmp(req->q.manpath, req->p[0])) { printf("%smanpath=", sep); http_print(req->q.manpath); } @@ -298,11 +297,6 @@ next: if (*qs != '\0') qs++; } - - /* Fall back to the default manpath. */ - - if (req->q.manpath == NULL) - req->q.manpath = mandoc_strdup(req->p[0]); } static void @@ -469,8 +463,7 @@ resp_searchform(const struct req *req) puts("