[BACK]Return to cgi.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/cgi.c between version 1.29 and 1.30

version 1.29, 2014/07/25 19:36:02 version 1.30, 2014/07/25 20:08:49
Line 847 
Line 847 
 format(const struct req *req, const char *file)  format(const struct req *req, const char *file)
 {  {
         struct mparse   *mp;          struct mparse   *mp;
         int              fd;  
         struct mdoc     *mdoc;          struct mdoc     *mdoc;
         struct man      *man;          struct man      *man;
         void            *vp;          void            *vp;
           char            *opts;
         enum mandoclevel rc;          enum mandoclevel rc;
         char             opts[PATH_MAX + 128];          int              fd;
           int              usepath;
   
         if (-1 == (fd = open(file, O_RDONLY, 0))) {          if (-1 == (fd = open(file, O_RDONLY, 0))) {
                 puts("<P>You specified an invalid manual file.</P>");                  puts("<P>You specified an invalid manual file.</P>");
Line 871 
Line 872 
                 return;                  return;
         }          }
   
         snprintf(opts, sizeof(opts), "fragment,man=%s?"          usepath = strcmp(req->q.manpath, req->p[0]);
             "manpath=%s&query=%%N&sec=%%S%s%s",          mandoc_asprintf(&opts,
             scriptname, req->q.manpath,              "fragment,man=%s?query=%%N&sec=%%S%s%s%s%s",
             req->q.arch ? "&arch=" : "",              scriptname,
             req->q.arch ? req->q.arch : "");              req->q.arch ? "&arch="       : "",
               req->q.arch ? req->q.arch    : "",
               usepath     ? "&manpath="    : "",
               usepath     ? req->q.manpath : "");
   
         mparse_result(mp, &mdoc, &man, NULL);          mparse_result(mp, &mdoc, &man, NULL);
         if (NULL == man && NULL == mdoc) {          if (NULL == man && NULL == mdoc) {
Line 895 
Line 899 
   
         html_free(vp);          html_free(vp);
         mparse_free(mp);          mparse_free(mp);
           free(opts);
 }  }
   
 static void  static void

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30