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

Diff for /mandoc/cgi.c between version 1.120 and 1.122

version 1.120, 2016/04/13 15:38:45 version 1.122, 2016/04/14 23:48:48
Line 55  struct req {
Line 55  struct req {
         struct query      q;          struct query      q;
         char            **p; /* array of available manpaths */          char            **p; /* array of available manpaths */
         size_t            psz; /* number of available manpaths */          size_t            psz; /* number of available manpaths */
           int               isquery; /* QUERY_STRING used, not PATH_INFO */
 };  };
   
 static  void             catman(const struct req *, const char *);  static  void             catman(const struct req *, const char *);
Line 188  http_parse(struct req *req, const char *qs)
Line 189  http_parse(struct req *req, const char *qs)
         char            *key, *val;          char            *key, *val;
         size_t           keysz, valsz;          size_t           keysz, valsz;
   
           req->isquery    = 1;
         req->q.manpath  = NULL;          req->q.manpath  = NULL;
         req->q.arch     = NULL;          req->q.arch     = NULL;
         req->q.sec      = NULL;          req->q.sec      = NULL;
Line 568  pg_searchres(const struct req *req, struct manpage *r,
Line 570  pg_searchres(const struct req *req, struct manpage *r,
                 return;                  return;
         }          }
   
         if (1 == sz) {          if (req->isquery && sz == 1) {
                 /*                  /*
                  * If we have just one result, then jump there now                   * If we have just one result, then jump there now
                  * without any delay.                   * without any delay.
Line 814  format(const struct req *req, const char *file)
Line 816  format(const struct req *req, const char *file)
         memset(&conf, 0, sizeof(conf));          memset(&conf, 0, sizeof(conf));
         conf.fragment = 1;          conf.fragment = 1;
         usepath = strcmp(req->q.manpath, req->p[0]);          usepath = strcmp(req->q.manpath, req->p[0]);
         mandoc_asprintf(&conf.man, "/%s?query=%%N&sec=%%S%s%s%s%s",          mandoc_asprintf(&conf.man, "/%s%s%%N.%%S",
             scriptname,              usepath ? req->q.manpath : "", usepath ? "/" : "");
             req->q.arch ? "&arch="       : "",  
             req->q.arch ? req->q.arch    : "",  
             usepath     ? "&manpath="    : "",  
             usepath     ? req->q.manpath : "");  
   
         mparse_result(mp, &man, NULL);          mparse_result(mp, &man, NULL);
         if (man == NULL) {          if (man == NULL) {
Line 1085  path_parse(struct req *req, const char *path)
Line 1083  path_parse(struct req *req, const char *path)
 {  {
         int      dir_done;          int      dir_done;
   
           req->isquery = 0;
         req->q.equal = 1;          req->q.equal = 1;
         req->q.manpath = mandoc_strdup(path);          req->q.manpath = mandoc_strdup(path);
   

Legend:
Removed from v.1.120  
changed lines
  Added in v.1.122

CVSweb