[BACK]Return to apropos.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / apropos

Diff for /src/usr.bin/apropos/Attic/apropos.c between version 1.9 and 1.13

version 1.9, 2003/06/03 02:56:05 version 1.13, 2007/08/06 19:16:06
Line 68 
Line 68 
 void usage(void);  void usage(void);
   
 int  int
 main(argc, argv)  main(int argc, char *argv[])
         int argc;  
         char *argv[];  
 {  {
         ENTRY *ep;          ENTRY *ep;
         TAG *tp;          TAG *tp;
Line 101 
Line 99 
         if (argc < 1)          if (argc < 1)
                 usage();                  usage();
   
         if ((found = malloc((u_int)argc * sizeof(int))) == NULL)          if ((found = calloc(argc, sizeof(int))) == NULL)
                 err(1, NULL);                  err(1, NULL);
         memset(found, 0, argc * sizeof(int));  
   
         for (p = argv; *p; ++p)                 /* convert to lower-case */          for (p = argv; *p; ++p)                 /* convert to lower-case */
                 lowstr(*p, *p);                  lowstr(*p, *p);
Line 115 
Line 112 
         else {          else {
                 config(conffile);                  config(conffile);
                 ep = (tp = getlist("_whatdb")) == NULL ?                  ep = (tp = getlist("_whatdb")) == NULL ?
                     NULL : tp->list.tqh_first;                      NULL : TAILQ_FIRST(&tp->list);
                 for (; ep != NULL; ep = ep->q.tqe_next)                  for (; ep != NULL; ep = TAILQ_NEXT(ep, q))
                         apropos(argv, ep->s, 0);                          apropos(argv, ep->s, 0);
         }          }
   
Line 133 
Line 130 
 }  }
   
 void  void
 apropos(argv, path, buildpath)  apropos(char **argv, char *path, int buildpath)
         char **argv, *path;  
         int buildpath;  
 {  {
         char *end, *name, **p;          char *end, *name, **p;
         char buf[MAXLINELEN + 1], wbuf[MAXLINELEN + 1];          char buf[MAXLINELEN + 1], wbuf[MAXLINELEN + 1];
Line 183 
Line 178 
  *      match anywhere the string appears   *      match anywhere the string appears
  */   */
 int  int
 match(bp, str)  match(char *bp, char *str)
         char *bp, *str;  
 {  {
         int len;          int len;
         char test;          char test;
Line 205 
Line 199 
  *      convert a string to lower case   *      convert a string to lower case
  */   */
 void  void
 lowstr(from, to)  lowstr(char *from, char *to)
         char *from, *to;  
 {  {
         char ch;          char ch;
   
Line 220 
Line 213 
  *      print usage message and die   *      print usage message and die
  */   */
 void  void
 usage()  usage(void)
 {  {
   
         (void)fprintf(stderr,          (void)fprintf(stderr,
             "usage: apropos [-C file] [-M path] [-m path] keyword [...]\n");              "usage: apropos [-C file] [-M path] [-m path] keyword ...\n");
         exit(1);          exit(1);
 }  }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.13