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

Diff for /mandoc/Attic/manpage.c between version 1.3 and 1.5

version 1.3, 2012/06/09 17:49:13 version 1.5, 2013/12/27 18:51:25
Line 17 
Line 17 
 #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
 #include "config.h"  #include "config.h"
 #endif  #endif
 #include <sys/param.h>  
   
 #include <assert.h>  #include <assert.h>
 #include <getopt.h>  #include <getopt.h>
   #include <limits.h>
 #include <stdint.h>  #include <stdint.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 40  main(int argc, char *argv[])
Line 40  main(int argc, char *argv[])
         struct mansearch search;          struct mansearch search;
         struct manpage  *res;          struct manpage  *res;
         char            *conf_file, *defpaths, *auxpaths, *cp;          char            *conf_file, *defpaths, *auxpaths, *cp;
         char             buf[MAXPATHLEN];          char             buf[PATH_MAX];
         const char      *cmd;          const char      *cmd;
         struct manpaths  paths;          struct manpaths  paths;
         char            *progname;          char            *progname;
Line 106  main(int argc, char *argv[])
Line 106  main(int argc, char *argv[])
   
         for (i = 0; i < sz; i++) {          for (i = 0; i < sz; i++) {
                 printf("%6zu  %s: %s\n",                  printf("%6zu  %s: %s\n",
                         i + 1, res[i].file, res[i].desc);                          i + 1, res[i].names, res[i].desc);
                   free(res[i].names);
                 free(res[i].desc);                  free(res[i].desc);
         }          }
   
         if (0 == term) {          if (0 == term) {
                   for (i = 0; i < sz; i++)
                           free(res[i].file);
                 free(res);                  free(res);
                 return(EXIT_SUCCESS);                  return(EXIT_SUCCESS);
         }          }
Line 127  main(int argc, char *argv[])
Line 130  main(int argc, char *argv[])
                 }                  }
   
         if (0 == i) {          if (0 == i) {
                   for (i = 0; i < sz; i++)
                           free(res[i].file);
                 free(res);                  free(res);
                 return(EXIT_SUCCESS);                  return(EXIT_SUCCESS);
         }          }
 show:  show:
         cmd = res[i - 1].form ? "mandoc" : "cat";          cmd = res[i - 1].form ? "mandoc" : "cat";
         strlcpy(buf, res[i - 1].file, MAXPATHLEN);          strlcpy(buf, res[i - 1].file, PATH_MAX);
           for (i = 0; i < sz; i++)
                   free(res[i].file);
         free(res);          free(res);
   
         show(cmd, buf);          show(cmd, buf);

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

CVSweb