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

Diff for /mandoc/Attic/apropos.c between version 1.2 and 1.3

version 1.2, 2011/10/07 13:22:33 version 1.3, 2011/10/07 13:29:03
Line 289  state_search(struct state *p, const struct opts *opts,
Line 289  state_search(struct state *p, const struct opts *opts,
         recno_t          rec;          recno_t          rec;
         uint32_t         fl;          uint32_t         fl;
         DBT              key, val;          DBT              key, val;
         struct res       res[MAXRESULTS];          struct res      *res;
         regex_t          reg;          regex_t          reg;
         regex_t         *regp;          regex_t         *regp;
         char             filebuf[10];          char             filebuf[10];
         struct rec       record;          struct rec       record;
   
           res = NULL;
         len = 0;          len = 0;
         buf = NULL;          buf = NULL;
         bufsz = 0;          bufsz = 0;
Line 341  state_search(struct state *p, const struct opts *opts,
Line 342  state_search(struct state *p, const struct opts *opts,
          * Lastly, add it to the available records.           * Lastly, add it to the available records.
          */           */
   
         while (len < MAXRESULTS) {          while (0 == (ch = (*p->db->seq)(p->db, &key, &val, dflag))) {
                 if ((ch = (*p->db->seq)(p->db, &key, &val, dflag)))  
                         break;  
   
                 dflag = R_NEXT;                  dflag = R_NEXT;
   
                 /*                  /*
Line 411  state_search(struct state *p, const struct opts *opts,
Line 409  state_search(struct state *p, const struct opts *opts,
                 if (i < len)                  if (i < len)
                         continue;                          continue;
   
                   res = mandoc_realloc
                           (res, (len + 1) * sizeof(struct res));
   
                 /*                  /*
                  * Now we have our filename, keywords, types, and all                   * Now we have our filename, keywords, types, and all
                  * other necessary information.                   * other necessary information.
Line 471  send:
Line 472  send:
                 free(res[len].uri);                  free(res[len].uri);
         }          }
   
           free(res);
         free(buf);          free(buf);
         mchars_free(mc);          mchars_free(mc);
   

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

CVSweb