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

Diff for /mandoc/mandocdb.c between version 1.181 and 1.182

version 1.181, 2015/01/02 17:02:19 version 1.182, 2015/01/03 12:55:25
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 1116  mpages_merge(struct mparse *mp)
Line 1116  mpages_merge(struct mparse *mp)
         mpage = ohash_first(&mpages, &pslot);          mpage = ohash_first(&mpages, &pslot);
         while (mpage != NULL) {          while (mpage != NULL) {
                 mlinks_undupe(mpage);                  mlinks_undupe(mpage);
                 if (mpage->mlinks == NULL) {                  if ((mlink = mpage->mlinks) == NULL) {
                         mpage = ohash_next(&mpages, &pslot);                          mpage = ohash_next(&mpages, &pslot);
                         continue;                          continue;
                 }                  }
Line 1129  mpages_merge(struct mparse *mp)
Line 1129  mpages_merge(struct mparse *mp)
                 man = NULL;                  man = NULL;
                 sodest = NULL;                  sodest = NULL;
   
                 mparse_open(mp, &fd, mpage->mlinks->file);                  mparse_open(mp, &fd, mlink->file);
                 if (fd == -1) {                  if (fd == -1) {
                         say(mpage->mlinks->file, "&open");                          say(mlink->file, "&open");
                         goto nextpage;                          goto nextpage;
                 }                  }
   
Line 1140  mpages_merge(struct mparse *mp)
Line 1140  mpages_merge(struct mparse *mp)
                  * 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 (mpage->mlinks->dform != FORM_CAT ||                  if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) {
                     mpage->mlinks->fform != FORM_CAT) {                          lvl = mparse_readfd(mp, fd, mlink->file);
                         lvl = mparse_readfd(mp, fd, mpage->mlinks->file);  
                         if (lvl < MANDOCLEVEL_FATAL)                          if (lvl < MANDOCLEVEL_FATAL)
                                 mparse_result(mp, &mdoc, &man, &sodest);                                  mparse_result(mp, &mdoc, &man, &sodest);
                 }                  }
Line 1161  mpages_merge(struct mparse *mp)
Line 1160  mpages_merge(struct mparse *mp)
                                 /* The .so target exists. */                                  /* The .so target exists. */
   
                                 mpage_dest = mlink_dest->mpage;                                  mpage_dest = mlink_dest->mpage;
                                 mlink = mpage->mlinks;  
                                 while (1) {                                  while (1) {
                                         mlink->mpage = mpage_dest;                                          mlink->mpage = mpage_dest;
   
Line 1201  mpages_merge(struct mparse *mp)
Line 1199  mpages_merge(struct mparse *mp)
                             mandoc_strdup(mdoc_meta(mdoc)->title);                              mandoc_strdup(mdoc_meta(mdoc)->title);
                 } else if (man != NULL) {                  } else if (man != NULL) {
                         mpage->form = FORM_SRC;                          mpage->form = FORM_SRC;
                         mpage->sec =                          mpage->sec = mandoc_strdup(man_meta(man)->msec);
                             mandoc_strdup(man_meta(man)->msec);                          mpage->arch = mandoc_strdup(mlink->arch);
                         mpage->arch =                          mpage->title = mandoc_strdup(man_meta(man)->title);
                             mandoc_strdup(mpage->mlinks->arch);  
                         mpage->title =  
                             mandoc_strdup(man_meta(man)->title);  
                 } else {                  } else {
                         mpage->form = FORM_CAT;                          mpage->form = FORM_CAT;
                         mpage->sec =                          mpage->sec = mandoc_strdup(mlink->dsec);
                             mandoc_strdup(mpage->mlinks->dsec);                          mpage->arch = mandoc_strdup(mlink->arch);
                         mpage->arch =                          mpage->title = mandoc_strdup(mlink->name);
                             mandoc_strdup(mpage->mlinks->arch);  
                         mpage->title =  
                             mandoc_strdup(mpage->mlinks->name);  
                 }                  }
                 putkey(mpage, mpage->sec, TYPE_sec);                  putkey(mpage, mpage->sec, TYPE_sec);
                 if (*mpage->arch != '\0')                  if (*mpage->arch != '\0')
                         putkey(mpage, mpage->arch, TYPE_arch);                          putkey(mpage, mpage->arch, TYPE_arch);
   
                 for (mlink = mpage->mlinks; mlink; mlink = mlink->next) {                  for ( ; mlink != NULL; mlink = mlink->next) {
                         if ('\0' != *mlink->dsec)                          if ('\0' != *mlink->dsec)
                                 putkey(mpage, mlink->dsec, TYPE_sec);                                  putkey(mpage, mlink->dsec, TYPE_sec);
                         if ('\0' != *mlink->fsec)                          if ('\0' != *mlink->fsec)
Line 1246  mpages_merge(struct mparse *mp)
Line 1238  mpages_merge(struct mparse *mp)
                                 mlink_check(mpage, mlink);                                  mlink_check(mpage, mlink);
   
                 dbadd(mpage);                  dbadd(mpage);
                   mlink = mpage->mlinks;
   
 nextpage:  nextpage:
                 if (mparse_wait(mp) != MANDOCLEVEL_OK) {                  if (mparse_wait(mp) != MANDOCLEVEL_OK) {
                         exitcode = (int)MANDOCLEVEL_SYSERR;                          exitcode = (int)MANDOCLEVEL_SYSERR;
                         say(mpage->mlinks->file, "&wait gunzip");                          say(mlink->file, "&wait gunzip");
                 }                  }
                 ohash_delete(&strings);                  ohash_delete(&strings);
                 ohash_delete(&names);                  ohash_delete(&names);

Legend:
Removed from v.1.181  
changed lines
  Added in v.1.182

CVSweb