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

Diff for /mandoc/mansearch.c between version 1.5 and 1.6

version 1.5, 2012/06/09 14:11:16 version 1.6, 2013/06/05 02:00:26
Line 18 
Line 18 
 #include "config.h"  #include "config.h"
 #endif  #endif
   
 #include <sys/param.h>  
   
 #include <assert.h>  #include <assert.h>
 #include <fcntl.h>  #include <fcntl.h>
 #include <getopt.h>  #include <getopt.h>
   #include <limits.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdint.h>  #include <stdint.h>
 #include <stddef.h>  #include <stddef.h>
Line 131  mansearch(const struct mansearch *search,
Line 130  mansearch(const struct mansearch *search,
 {  {
         int              fd, rc, c;          int              fd, rc, c;
         int64_t          id;          int64_t          id;
         char             buf[MAXPATHLEN];          char             buf[PATH_MAX];
         char            *sql;          char            *sql;
         struct expr     *e, *ep;          struct expr     *e, *ep;
         sqlite3         *db;          sqlite3         *db;
Line 168  mansearch(const struct mansearch *search,
Line 167  mansearch(const struct mansearch *search,
          * on our current directory from which to start the chdir().           * on our current directory from which to start the chdir().
          */           */
   
         if (NULL == getcwd(buf, MAXPATHLEN)) {          if (NULL == getcwd(buf, PATH_MAX)) {
                 perror(NULL);                  perror(NULL);
                 goto out;                  goto out;
         } else if (-1 == (fd = open(buf, O_RDONLY, 0))) {          } else if (-1 == (fd = open(buf, O_RDONLY, 0))) {
Line 266  mansearch(const struct mansearch *search,
Line 265  mansearch(const struct mansearch *search,
                                         (*res, maxres * sizeof(struct manpage));                                          (*res, maxres * sizeof(struct manpage));
                         }                          }
                         strlcpy((*res)[cur].file,                          strlcpy((*res)[cur].file,
                                 paths->paths[i], MAXPATHLEN);                                  paths->paths[i], PATH_MAX);
                         strlcat((*res)[cur].file, "/", MAXPATHLEN);                          strlcat((*res)[cur].file, "/", PATH_MAX);
                         strlcat((*res)[cur].file, mp->file, MAXPATHLEN);                          strlcat((*res)[cur].file, mp->file, PATH_MAX);
                         (*res)[cur].desc = mp->desc;                          (*res)[cur].desc = mp->desc;
                         (*res)[cur].form = mp->form;                          (*res)[cur].form = mp->form;
                         free(mp->file);                          free(mp->file);

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

CVSweb