[BACK]Return to cgi.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/cgi.c between version 1.101 and 1.102

version 1.101, 2014/11/11 19:04:55 version 1.102, 2014/11/26 17:55:27
Line 163  http_printquery(const struct req *req, const char *sep
Line 163  http_printquery(const struct req *req, const char *sep
                 printf("%sarch=", sep);                  printf("%sarch=", sep);
                 http_print(req->q.arch);                  http_print(req->q.arch);
         }          }
         if (NULL != req->q.manpath &&          if (strcmp(req->q.manpath, req->p[0])) {
             strcmp(req->q.manpath, req->p[0])) {  
                 printf("%smanpath=", sep);                  printf("%smanpath=", sep);
                 http_print(req->q.manpath);                  http_print(req->q.manpath);
         }          }
Line 298  next:
Line 297  next:
                 if (*qs != '\0')                  if (*qs != '\0')
                         qs++;                          qs++;
         }          }
   
         /* Fall back to the default manpath. */  
   
         if (req->q.manpath == NULL)  
                 req->q.manpath = mandoc_strdup(req->p[0]);  
 }  }
   
 static void  static void
Line 469  resp_searchform(const struct req *req)
Line 463  resp_searchform(const struct req *req)
                 puts("<SELECT NAME=\"manpath\">");                  puts("<SELECT NAME=\"manpath\">");
                 for (i = 0; i < (int)req->psz; i++) {                  for (i = 0; i < (int)req->psz; i++) {
                         printf("<OPTION ");                          printf("<OPTION ");
                         if (NULL == req->q.manpath ? 0 == i :                          if (strcmp(req->q.manpath, req->p[i]) == 0)
                             0 == strcmp(req->q.manpath, req->p[i]))  
                                 printf("SELECTED=\"selected\" ");                                  printf("SELECTED=\"selected\" ");
                         printf("VALUE=\"");                          printf("VALUE=\"");
                         html_print(req->p[i]);                          html_print(req->p[i]);
Line 1081  main(void)
Line 1074  main(void)
         if (NULL != (querystring = getenv("QUERY_STRING")))          if (NULL != (querystring = getenv("QUERY_STRING")))
                 http_parse(&req, querystring);                  http_parse(&req, querystring);
   
         if ( ! (NULL == req.q.manpath ||          if (req.q.manpath == NULL)
             validate_manpath(&req, req.q.manpath))) {                  req.q.manpath = mandoc_strdup(req.p[0]);
           else if ( ! validate_manpath(&req, req.q.manpath)) {
                 pg_error_badrequest(                  pg_error_badrequest(
                     "You specified an invalid manpath.");                      "You specified an invalid manpath.");
                 return(EXIT_FAILURE);                  return(EXIT_FAILURE);

Legend:
Removed from v.1.101  
changed lines
  Added in v.1.102

CVSweb