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 0c9538f3; for ; Wed, 26 Nov 2014 12:55:27 -0500 (EST) Date: Wed, 26 Nov 2014 12:55:27 -0500 (EST) Message-Id: <17045255164072772810.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: Make the code sipler and more robust by always assigning a value X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Make the code sipler and more robust by always assigning a value to q.manpath and dropping the (incomplete) later NULL checks. Modified Files: -------------- mdocml: cgi.c Revision Data ------------- Index: cgi.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/cgi.c,v retrieving revision 1.101 retrieving revision 1.102 diff -Lcgi.c -Lcgi.c -u -p -r1.101 -r1.102 --- cgi.c +++ cgi.c @@ -163,8 +163,7 @@ http_printquery(const struct req *req, c 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("