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

Diff for /mandoc/cgi.c between version 1.126 and 1.127

version 1.126, 2016/04/15 01:34:51 version 1.127, 2016/04/15 15:13:07
Line 1085  main(void)
Line 1085  main(void)
 static void  static void
 path_parse(struct req *req, const char *path)  path_parse(struct req *req, const char *path)
 {  {
         int      dir_done;          char    *dir;
   
         req->isquery = 0;          req->isquery = 0;
         req->q.equal = 1;          req->q.equal = 1;
Line 1115  path_parse(struct req *req, const char *path)
Line 1115  path_parse(struct req *req, const char *path)
         req->q.query = mandoc_strdup(req->q.query);          req->q.query = mandoc_strdup(req->q.query);
   
         /* Optional architecture. */          /* Optional architecture. */
         dir_done = 0;          dir = strrchr(req->q.manpath, '/');
         for (;;) {          if (dir != NULL && strncmp(dir + 1, "man", 3) != 0) {
                 if ((req->q.arch = strrchr(req->q.manpath, '/')) == NULL)                  *dir++ = '\0';
                         break;                  req->q.arch = mandoc_strdup(dir);
                 *req->q.arch++ = '\0';                  dir = strrchr(req->q.manpath, '/');
                 if (dir_done || strncmp(req->q.arch, "man", 3)) {          } else
                         req->q.arch = mandoc_strdup(req->q.arch);                  req->q.arch = NULL;
                         break;  
                 }  
   
                 /* Optional directory name. */          /* Optional directory name. */
                 req->q.arch += 3;          if (dir != NULL && strncmp(dir + 1, "man", 3) == 0) {
                 if (*req->q.arch != '\0') {                  *dir++ = '\0';
                         free(req->q.sec);                  free(req->q.sec);
                         req->q.sec = mandoc_strdup(req->q.arch);                  req->q.sec = mandoc_strdup(dir + 3);
                 }  
                 dir_done = 1;  
         }          }
 }  }
   

Legend:
Removed from v.1.126  
changed lines
  Added in v.1.127

CVSweb