- if (search.argmode == ARG_NAME) {
- for (c = 0; c < argc; c++) {
- if (strchr(argv[c], '/') == NULL)
+ if (search.argmode == ARG_NAME) {
+ if (argc < 1)
+ usage(ARG_NAME);
+ for (res = NULL, ressz = 0; argc > 0; argc--, argv++) {
+ (void)mansearch(&search, &conf.manpath,
+ 1, argv, &resn, &resnsz);
+ if (resnsz == 0)
+ (void)fs_search(&search, &conf.manpath,
+ 1, argv, &resn, &resnsz);
+ if (resnsz == 0) {
+ if (strchr(*argv, '/') == NULL) {
+ mandoc_msg_setrc(MANDOCLEVEL_BADARG);