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

Diff for /mandoc/Attic/apropos.c between version 1.33 and 1.35

version 1.33, 2012/06/09 17:49:13 version 1.35, 2013/12/27 18:51:25
Line 37  main(int argc, char *argv[])
Line 37  main(int argc, char *argv[])
         struct mansearch search;          struct mansearch search;
         size_t           i, sz;          size_t           i, sz;
         struct manpage  *res;          struct manpage  *res;
         char            *conf_file, *defpaths, *auxpaths;  
         struct manpaths  paths;          struct manpaths  paths;
           char            *defpaths, *auxpaths;
           char            *conf_file;
         char            *progname;          char            *progname;
         extern char     *optarg;          extern char     *optarg;
         extern int       optind;          extern int       optind;
Line 49  main(int argc, char *argv[])
Line 50  main(int argc, char *argv[])
         else          else
                 ++progname;                  ++progname;
   
         auxpaths = defpaths = conf_file = NULL;          whatis = (0 == strncmp(progname, "whatis", 6));
   
         memset(&paths, 0, sizeof(struct manpaths));          memset(&paths, 0, sizeof(struct manpaths));
         memset(&search, 0, sizeof(struct mansearch));          memset(&search, 0, sizeof(struct mansearch));
         whatis = (0 == strcmp(progname, "whatis"));  
   
           auxpaths = defpaths = NULL;
           conf_file = NULL;
   
         while (-1 != (ch = getopt(argc, argv, "C:M:m:S:s:")))          while (-1 != (ch = getopt(argc, argv, "C:M:m:S:s:")))
                 switch (ch) {                  switch (ch) {
                 case ('C'):                  case ('C'):
Line 92  main(int argc, char *argv[])
Line 96  main(int argc, char *argv[])
                 goto usage;                  goto usage;
   
         for (i = 0; i < sz; i++) {          for (i = 0; i < sz; i++) {
                 printf("%s - %s\n", res[i].file, res[i].desc);                  printf("%s - %s\n", res[i].names, res[i].desc);
                   free(res[i].file);
                   free(res[i].names);
                 free(res[i].desc);                  free(res[i].desc);
         }          }
   
         free(res);          free(res);
         return(sz ? EXIT_SUCCESS : EXIT_FAILURE);          return(sz ? EXIT_SUCCESS : EXIT_FAILURE);
 usage:  usage:
         fprintf(stderr, "usage: %s [-C conf] "          fprintf(stderr, "usage: %s [-C file] [-M path] [-m path] "
                                   "[-M paths] "                          "[-S arch] [-s section]%s ...\n", progname,
                                   "[-m paths] "                          whatis ? " name" : "\n               expression");
                                   "[-S arch] "  
                                   "[-s section] "  
                                   "expr ...\n",  
                                   progname);  
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
 }  }

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

CVSweb