version 1.218, 2015/02/03 21:16:02 |
version 1.220, 2015/02/10 08:05:30 |
Line 134 main(int argc, char *argv[]) |
|
Line 134 main(int argc, char *argv[]) |
|
int options; |
int options; |
int c; |
int c; |
|
|
progname = strrchr(argv[0], '/'); |
if (argc < 1) |
if (progname == NULL) |
progname = "mandoc"; |
|
else if ((progname = strrchr(argv[0], '/')) == NULL) |
progname = argv[0]; |
progname = argv[0]; |
else |
else |
++progname; |
++progname; |
Line 287 main(int argc, char *argv[]) |
|
Line 288 main(int argc, char *argv[]) |
|
|
|
/* Parse arguments. */ |
/* Parse arguments. */ |
|
|
argc -= optind; |
if (argc > 0) { |
argv += optind; |
argc -= optind; |
|
argv += optind; |
|
} |
resp = NULL; |
resp = NULL; |
|
|
/* |
/* |
Line 414 main(int argc, char *argv[]) |
|
Line 417 main(int argc, char *argv[]) |
|
if (OUTT_MAN == curp.outtype) |
if (OUTT_MAN == curp.outtype) |
mparse_keep(curp.mp); |
mparse_keep(curp.mp); |
|
|
if (argc == 0) { |
if (argc < 1) { |
if (use_pager && isatty(STDOUT_FILENO)) |
if (use_pager && isatty(STDOUT_FILENO)) |
spawn_pager(); |
spawn_pager(); |
parse(&curp, STDIN_FILENO, "<stdin>", &rc); |
parse(&curp, STDIN_FILENO, "<stdin>", &rc); |
} |
} |
|
|
while (argc) { |
while (argc > 0) { |
rctmp = mparse_open(curp.mp, &fd, |
rctmp = mparse_open(curp.mp, &fd, |
resp != NULL ? resp->file : *argv); |
resp != NULL ? resp->file : *argv); |
if (rc < rctmp) |
if (rc < rctmp) |
|
|
" consider running # makewhatis %s\n", |
" consider running # makewhatis %s\n", |
progname, name, sec, paths->paths[ipath]); |
progname, name, sec, paths->paths[ipath]); |
#endif |
#endif |
|
|
*res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); |
*res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); |
page = *res + (*ressz - 1); |
page = *res + (*ressz - 1); |
page->file = file; |
page->file = file; |