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

Diff for /mandoc/mandocdb.c between version 1.72 and 1.77

version 1.72, 2013/10/18 21:10:07 version 1.77, 2013/12/26 19:02:04
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 = "";
   
                 /*                  /*
Line 1365  parse_man(struct of *of, const struct man_node *n)
Line 1366  parse_man(struct of *of, const struct man_node *n)
                 }                  }
         }          }
   
         for (n = n->child; n; n = n->next)          for (n = n->child; n; n = n->next) {
                   if (NULL != of->desc)
                           break;
                 parse_man(of, n);                  parse_man(of, n);
           }
 }  }
   
 static void  static void
Line 1792  dbindex(struct mchars *mc, int form, const struct of *
Line 1796  dbindex(struct mchars *mc, int form, const struct of *
                 return;                  return;
   
         desc = "";          desc = "";
         if (NULL != of->desc) {          if (NULL != of->desc && '\0' != *of->desc) {
                 key = ohash_find(&strings,                  key = ohash_find(&strings,
                         ohash_qlookup(&strings, of->desc));                          ohash_qlookup(&strings, of->desc));
                 assert(NULL != key);                  assert(NULL != key);

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.77

CVSweb