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

Diff for /mandoc/mandocdb.c between version 1.73 and 1.76

version 1.73, 2013/10/18 23:07:23 version 1.76, 2013/10/27 17:01:18
Line 836  ofadd(int dform, const char *file, const char *name, c
Line 836  ofadd(int dform, const char *file, const char *name, c
         if (NULL == arch)          if (NULL == arch)
                 arch = "";                  arch = "";
   
         sform = FORM_NONE;          if ('0' == *sec) {
         if (NULL != sec && *sec <= '9' && *sec >= '1')  
                 sform = FORM_SRC;  
         else if (NULL != sec && *sec == '0') {  
                 sec = dsec;                  sec = dsec;
                 sform = FORM_CAT;                  sform = FORM_CAT;
         }          } else if ('1' <= *sec && '9' >= *sec)
                   sform = FORM_SRC;
           else
                   sform = FORM_NONE;
   
         of = mandoc_calloc(1, sizeof(struct of));          of = mandoc_calloc(1, sizeof(struct of));
         strlcpy(of->file, file, PATH_MAX);          strlcpy(of->file, file, PATH_MAX);
Line 950  ofmerge(struct mchars *mc, struct mparse *mp, int chec
Line 950  ofmerge(struct mchars *mc, struct mparse *mp, int chec
                 mparse_reset(mp);                  mparse_reset(mp);
                 mdoc = NULL;                  mdoc = NULL;
                 man = NULL;                  man = NULL;
                 form = 0;  
                 msec = of->dsec;  
                 march = of->arch;  
                 mtitle = of->name;  
                 match = 1;                  match = 1;
   
                 /*                  /*
Line 961  ofmerge(struct mchars *mc, struct mparse *mp, int chec
Line 957  ofmerge(struct mchars *mc, struct mparse *mp, int chec
                  * source code, unless it is already known to be                   * source code, unless it is already known to be
                  * formatted.  Fall back to formatted mode.                   * formatted.  Fall back to formatted mode.
                  */                   */
                 if (FORM_SRC == of->dform || FORM_SRC == of->sform) {                  if (FORM_CAT != of->dform || FORM_CAT != of->sform) {
                         lvl = mparse_readfd(mp, -1, of->file);                          lvl = mparse_readfd(mp, -1, of->file);
                         if (lvl < MANDOCLEVEL_FATAL)                          if (lvl < MANDOCLEVEL_FATAL)
                                 mparse_result(mp, &mdoc, &man);                                  mparse_result(mp, &mdoc, &man);
                 }                  }
   
                 if (NULL != mdoc) {                  if (NULL != mdoc) {
                         form = 1;                          form = 1;
Line 975  ofmerge(struct mchars *mc, struct mparse *mp, int chec
Line 971  ofmerge(struct mchars *mc, struct mparse *mp, int chec
                 } else if (NULL != man) {                  } else if (NULL != man) {
                         form = 1;                          form = 1;
                         msec = man_meta(man)->msec;                          msec = man_meta(man)->msec;
                         march = "";                          march = of->arch;
                         mtitle = man_meta(man)->title;                          mtitle = man_meta(man)->title;
                 }                  } else {
                           form = 0;
                           msec = of->dsec;
                           march = of->arch;
                           mtitle = of->name;
                   }
   
                 if (NULL == msec)                  if (NULL == msec)
                         msec = "";                          msec = "";
                 if (NULL == march)                  if (NULL == march)
                         march = "";                          march = "";
                 if (NULL == mtitle)                  if (NULL == mtitle)
                         mtitle = "";                          mtitle = "";
   
                 /*                  /*

Legend:
Removed from v.1.73  
changed lines
  Added in v.1.76

CVSweb