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

Diff for /mandoc/dba_read.c between version 1.3 and 1.5

version 1.3, 2016/08/17 18:59:37 version 1.5, 2020/06/22 19:20:40
Line 1 
Line 1 
 /*      $Id$ */  /* $Id$ */
 /*  /*
  * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
  *   *
Line 19 
Line 19 
  * The interface is defined in "dba.h".   * The interface is defined in "dba.h".
  * This file is seperate from dba.c because this also uses "dbm.h".   * This file is seperate from dba.c because this also uses "dbm.h".
  */   */
   #include "config.h"
   
 #include <regex.h>  #include <regex.h>
 #include <stdint.h>  #include <stdint.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 48  dba_read(const char *fname)
Line 50  dba_read(const char *fname)
         dba = dba_new(npages < 128 ? 128 : npages);          dba = dba_new(npages < 128 ? 128 : npages);
         for (ip = 0; ip < npages; ip++) {          for (ip = 0; ip < npages; ip++) {
                 pdata = dbm_page_get(ip);                  pdata = dbm_page_get(ip);
                 page = dba_page_new(dba->pages, NULL, pdata->sect,                  page = dba_page_new(dba->pages, pdata->arch,
                     pdata->arch, pdata->desc, pdata->file + 1, *pdata->file);                      pdata->desc, pdata->file + 1, *pdata->file);
                 for (cp = pdata->name; *cp != '\0'; cp = strchr(cp, '\0') + 1)                  for (cp = pdata->name; *cp != '\0'; cp = strchr(cp, '\0') + 1)
                         dba_page_add(page, DBP_NAME, cp);                          dba_page_add(page, DBP_NAME, cp);
                 cp = pdata->sect;                  for (cp = pdata->sect; *cp != '\0'; cp = strchr(cp, '\0') + 1)
                 while (*(cp = strchr(cp, '\0') + 1) != '\0')  
                         dba_page_add(page, DBP_SECT, cp);                          dba_page_add(page, DBP_SECT, cp);
                 if ((cp = pdata->arch) != NULL)                  if ((cp = pdata->arch) != NULL)
                         while (*(cp = strchr(cp, '\0') + 1) != '\0')                          while (*(cp = strchr(cp, '\0') + 1) != '\0')

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

CVSweb