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

Diff for /mandoc/mandocdb.c between version 1.35 and 1.36

version 1.35, 2011/12/16 08:04:34 version 1.36, 2011/12/16 12:06:35
Line 528  index_merge(const struct of *of, struct mparse *mp,
Line 528  index_merge(const struct of *of, struct mparse *mp,
         size_t           sv;          size_t           sv;
         unsigned         seq;          unsigned         seq;
         struct db_val    vbuf;          struct db_val    vbuf;
           char             type;
   
         for (rec = 0; of; of = of->next) {          for (rec = 0; of; of = of->next) {
                 fn = of->fname;                  fn = of->fname;
Line 608  index_merge(const struct of *of, struct mparse *mp,
Line 609  index_merge(const struct of *of, struct mparse *mp,
                  */                   */
   
                 dbuf->len = 0;                  dbuf->len = 0;
                 buf_append(dbuf, mdoc ? "mdoc" : (man ? "man" : "cat"));                  type = mdoc ? 'd' : (man ? 'a' : 'c');
                   buf_appendb(dbuf, &type, 1);
                 buf_appendb(dbuf, fn, strlen(fn) + 1);                  buf_appendb(dbuf, fn, strlen(fn) + 1);
                 buf_appendb(dbuf, msec, strlen(msec) + 1);                  buf_appendb(dbuf, msec, strlen(msec) + 1);
                 buf_appendb(dbuf, mtitle, strlen(mtitle) + 1);                  buf_appendb(dbuf, mtitle, strlen(mtitle) + 1);
Line 696  index_prune(const struct of *ofile, DB *db, const char
Line 698  index_prune(const struct of *ofile, DB *db, const char
                 recno_t **recs, size_t *recsz, size_t *reccur)                  recno_t **recs, size_t *recsz, size_t *reccur)
 {  {
         const struct of *of;          const struct of *of;
         const char      *fn, *cp;          const char      *fn;
         struct db_val   *vbuf;          struct db_val   *vbuf;
         unsigned         seq, sseq;          unsigned         seq, sseq;
         DBT              key, val;          DBT              key, val;
Line 707  index_prune(const struct of *ofile, DB *db, const char
Line 709  index_prune(const struct of *ofile, DB *db, const char
         while (0 == (ch = (*idx->seq)(idx, &key, &val, seq))) {          while (0 == (ch = (*idx->seq)(idx, &key, &val, seq))) {
                 seq = R_NEXT;                  seq = R_NEXT;
                 *maxrec = *(recno_t *)key.data;                  *maxrec = *(recno_t *)key.data;
                 cp = val.data;  
   
                 /* Deleted records are zero-sized.  Skip them. */                  /* Deleted records are zero-sized.  Skip them. */
   
Line 721  index_prune(const struct of *ofile, DB *db, const char
Line 722  index_prune(const struct of *ofile, DB *db, const char
                  * Failing any of these, we go into our error handler.                   * Failing any of these, we go into our error handler.
                  */                   */
   
                 if (NULL == (fn = memchr(cp, '\0', val.size)))                  fn = (char *)val.data + 1;
                         break;                  if (NULL == memchr(fn, '\0', val.size - 1))
                 if (++fn - cp >= (int)val.size)  
                         break;  
                 if (NULL == memchr(fn, '\0', val.size - (fn - cp)))  
                         break;                          break;
   
                 /*                  /*

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

CVSweb