- if (0 == argc) {
- rc = 1;
- goto out;
- }
-
- if (0 == paths.sz && ! manpath_add(&paths, "."))
- goto out;
-
- if (NULL == (e = exprcomp(argc, argv, &terms))) {
- /* FIXME: be more specific about this. */
- fprintf(stderr, "Bad expression\n");
- goto out;
- }
-
- rc = apropos_search
- (paths.sz, paths.paths,
- &opts, e, terms, NULL, list);
-
- /* FIXME: report an error based on ch. */
-
-out:
- for (i = 0; i < paths.sz; i++)
- free(paths.paths[i]);
-
- free(paths.paths);
- exprfree(e);
-
- return(rc ? EXIT_SUCCESS : EXIT_FAILURE);
-}
-
-/* ARGSUSED */
-static void
-list(struct res *res, size_t sz, void *arg)
-{
- int i;
-
- qsort(res, sz, sizeof(struct res), cmp);