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

Diff for /src/usr.bin/mandoc/Attic/apropos.c between version 1.16 and 1.17

version 1.16, 2012/04/15 11:54:47 version 1.17, 2013/07/12 11:01:42
Line 43 
Line 43 
         struct expr     *e;          struct expr     *e;
         char            *defpaths, *auxpaths;          char            *defpaths, *auxpaths;
         char            *conf_file;          char            *conf_file;
         extern int       optind;  
         extern char     *optarg;          extern char     *optarg;
           extern int       optind;
   
         progname = strrchr(argv[0], '/');          progname = strrchr(argv[0], '/');
         if (progname == NULL)          if (progname == NULL)
Line 52 
Line 52 
         else          else
                 ++progname;                  ++progname;
   
         whatis = 0 == strncmp(progname, "whatis", 6);          whatis = (0 == strncmp(progname, "whatis", 6));
   
         memset(&paths, 0, sizeof(struct manpaths));          memset(&paths, 0, sizeof(struct manpaths));
         memset(&opts, 0, sizeof(struct opts));          memset(&opts, 0, sizeof(struct opts));
Line 81 
Line 81 
                         opts.cat = optarg;                          opts.cat = optarg;
                         break;                          break;
                 default:                  default:
                         fprintf(stderr,                          goto usage;
                             "usage: %s [-C file] [-M path] [-m path]"  
                             " [-S arch] [-s section]%s ...\n",  
                             progname,  
                             whatis ? " name" :  
                                 "\n               expression");  
                         return(EXIT_FAILURE);  
                 }                  }
   
         argc -= optind;          argc -= optind;
         argv += optind;          argv += optind;
   
         if (0 == argc)          if (0 == argc)
                 return(EXIT_SUCCESS);                  goto usage;
   
         rc = 0;          rc = 0;
   
Line 116 
Line 110 
                 fprintf(stderr, "%s: Bad database\n", progname);                  fprintf(stderr, "%s: Bad database\n", progname);
                 goto out;                  goto out;
         }          }
   
 out:  out:
         manpath_free(&paths);          manpath_free(&paths);
         resfree(res, ressz);          resfree(res, ressz);
         exprfree(e);          exprfree(e);
         return(rc ? EXIT_SUCCESS : EXIT_FAILURE);          return(rc ? EXIT_SUCCESS : EXIT_FAILURE);
   
   usage:
           fprintf(stderr, "usage: %s [-C file] [-M path] [-m path] "
                           "[-S arch] [-s section]%s ...\n", progname,
                           whatis ? " name" : "\n               expression");
           return(EXIT_FAILURE);
 }  }
   
 /* ARGSUSED */  /* ARGSUSED */

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17