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

Diff for /mandoc/mandocdb.c between version 1.191 and 1.195

version 1.191, 2015/04/18 16:06:40 version 1.195, 2015/07/19 06:05:16
Line 1107  mpages_merge(struct mparse *mp)
Line 1107  mpages_merge(struct mparse *mp)
         struct ohash_info        str_info;          struct ohash_info        str_info;
         struct mpage            *mpage, *mpage_dest;          struct mpage            *mpage, *mpage_dest;
         struct mlink            *mlink, *mlink_dest;          struct mlink            *mlink, *mlink_dest;
         struct roff_man         *mdoc;  
         struct roff_man         *man;          struct roff_man         *man;
         char                    *sodest;          char                    *sodest;
         char                    *cp;          char                    *cp;
Line 1135  mpages_merge(struct mparse *mp)
Line 1134  mpages_merge(struct mparse *mp)
                 ohash_init(&names, 4, &str_info);                  ohash_init(&names, 4, &str_info);
                 ohash_init(&strings, 6, &str_info);                  ohash_init(&strings, 6, &str_info);
                 mparse_reset(mp);                  mparse_reset(mp);
                 mdoc = NULL;  
                 man = NULL;                  man = NULL;
                 sodest = NULL;                  sodest = NULL;
   
Line 1151  mpages_merge(struct mparse *mp)
Line 1149  mpages_merge(struct mparse *mp)
                  */                   */
                 if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) {                  if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) {
                         mparse_readfd(mp, fd, mlink->file);                          mparse_readfd(mp, fd, mlink->file);
                         mparse_result(mp, &mdoc, &man, &sodest);                          mparse_result(mp, &man, &sodest);
                 }                  }
   
                 if (sodest != NULL) {                  if (sodest != NULL) {
Line 1195  mpages_merge(struct mparse *mp)
Line 1193  mpages_merge(struct mparse *mp)
                                 mpage->mlinks = NULL;                                  mpage->mlinks = NULL;
                         }                          }
                         goto nextpage;                          goto nextpage;
                 } else if (mdoc != NULL) {                  } else if (man != NULL && man->macroset == MACROSET_MDOC) {
                         mpage->form = FORM_SRC;                          mpage->form = FORM_SRC;
                         mpage->sec = mdoc_meta(mdoc)->msec;                          mpage->sec = man->meta.msec;
                         mpage->sec = mandoc_strdup(                          mpage->sec = mandoc_strdup(
                             mpage->sec == NULL ? "" : mpage->sec);                              mpage->sec == NULL ? "" : mpage->sec);
                         mpage->arch = mdoc_meta(mdoc)->arch;                          mpage->arch = man->meta.arch;
                         mpage->arch = mandoc_strdup(                          mpage->arch = mandoc_strdup(
                             mpage->arch == NULL ? "" : mpage->arch);                              mpage->arch == NULL ? "" : mpage->arch);
                         mpage->title =                          mpage->title = mandoc_strdup(man->meta.title);
                             mandoc_strdup(mdoc_meta(mdoc)->title);                  } else if (man != NULL && man->macroset == MACROSET_MAN) {
                 } else if (man != NULL) {  
                         mpage->form = FORM_SRC;                          mpage->form = FORM_SRC;
                         mpage->sec = mandoc_strdup(man_meta(man)->msec);                          mpage->sec = mandoc_strdup(man->meta.msec);
                         mpage->arch = mandoc_strdup(mlink->arch);                          mpage->arch = mandoc_strdup(mlink->arch);
                         mpage->title = mandoc_strdup(man_meta(man)->title);                          mpage->title = mandoc_strdup(man->meta.title);
                 } else {                  } else {
                         mpage->form = FORM_CAT;                          mpage->form = FORM_CAT;
                         mpage->sec = mandoc_strdup(mlink->dsec);                          mpage->sec = mandoc_strdup(mlink->dsec);
Line 1231  mpages_merge(struct mparse *mp)
Line 1228  mpages_merge(struct mparse *mp)
                 }                  }
   
                 assert(mpage->desc == NULL);                  assert(mpage->desc == NULL);
                 if (mdoc != NULL)                  if (man != NULL && man->macroset == MACROSET_MDOC)
                         parse_mdoc(mpage, mdoc_meta(mdoc), mdoc_node(mdoc));                          parse_mdoc(mpage, &man->meta, man->first);
                 else if (man != NULL)                  else if (man != NULL)
                         parse_man(mpage, man_meta(man), man_node(man));                          parse_man(mpage, &man->meta, man->first);
                 else                  else
                         parse_cat(mpage, fd);                          parse_cat(mpage, fd);
                 if (mpage->desc == NULL)                  if (mpage->desc == NULL)
Line 1249  mpages_merge(struct mparse *mp)
Line 1246  mpages_merge(struct mparse *mp)
                 mlink = mpage->mlinks;                  mlink = mpage->mlinks;
   
 nextpage:  nextpage:
                 if (mparse_wait(mp) != MANDOCLEVEL_OK) {  
                         exitcode = (int)MANDOCLEVEL_SYSERR;  
                         say(mlink->file, "&wait gunzip");  
                 }  
                 ohash_delete(&strings);                  ohash_delete(&strings);
                 ohash_delete(&names);                  ohash_delete(&names);
                 mpage = ohash_next(&mpages, &pslot);                  mpage = ohash_next(&mpages, &pslot);
Line 1479  parse_man(struct mpage *mpage, const struct roff_meta 
Line 1472  parse_man(struct mpage *mpage, const struct roff_meta 
                          */                           */
   
                         title = NULL;                          title = NULL;
                         man_deroff(&title, body);                          deroff(&title, body);
                         if (NULL == title)                          if (NULL == title)
                                 return;                                  return;
   
Line 1723  parse_mdoc_Nd(struct mpage *mpage, const struct roff_m
Line 1716  parse_mdoc_Nd(struct mpage *mpage, const struct roff_m
 {  {
   
         if (n->type == ROFFT_BODY)          if (n->type == ROFFT_BODY)
                 mdoc_deroff(&mpage->desc, n);                  deroff(&mpage->desc, n);
         return(0);          return(0);
 }  }
   

Legend:
Removed from v.1.191  
changed lines
  Added in v.1.195

CVSweb