version 1.240, 2015/07/18 05:47:32 |
version 1.243, 2015/07/21 03:26:21 |
Line 419 main(int argc, char *argv[]) |
|
Line 419 main(int argc, char *argv[]) |
|
if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths)) |
if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths)) |
return((int)MANDOCLEVEL_BADARG); |
return((int)MANDOCLEVEL_BADARG); |
|
|
|
if (pager_pid == 1 && isatty(STDOUT_FILENO) == 0) |
|
pager_pid = 0; |
|
|
curp.mchars = mchars_alloc(); |
curp.mchars = mchars_alloc(); |
curp.mp = mparse_alloc(options, curp.wlevel, mmsg, |
curp.mp = mparse_alloc(options, curp.wlevel, mmsg, |
curp.mchars, defos); |
curp.mchars, defos); |
Line 430 main(int argc, char *argv[]) |
|
Line 433 main(int argc, char *argv[]) |
|
mparse_keep(curp.mp); |
mparse_keep(curp.mp); |
|
|
if (argc < 1) { |
if (argc < 1) { |
if (pager_pid == 1 && isatty(STDOUT_FILENO)) |
if (pager_pid == 1) |
pager_pid = spawn_pager(); |
pager_pid = spawn_pager(); |
parse(&curp, STDIN_FILENO, "<stdin>"); |
parse(&curp, STDIN_FILENO, "<stdin>"); |
} |
} |
Line 442 main(int argc, char *argv[]) |
|
Line 445 main(int argc, char *argv[]) |
|
rc = rctmp; |
rc = rctmp; |
|
|
if (fd != -1) { |
if (fd != -1) { |
if (pager_pid == 1 && isatty(STDOUT_FILENO)) |
if (pager_pid == 1) |
pager_pid = spawn_pager(); |
pager_pid = spawn_pager(); |
|
|
if (resp == NULL) |
if (resp == NULL) |
Line 455 main(int argc, char *argv[]) |
|
Line 458 main(int argc, char *argv[]) |
|
passthrough(resp->file, fd, |
passthrough(resp->file, fd, |
conf.output.synopsisonly); |
conf.output.synopsisonly); |
|
|
rctmp = mparse_wait(curp.mp); |
|
if (rc < rctmp) |
|
rc = rctmp; |
|
|
|
if (argc > 1 && curp.outtype <= OUTT_UTF8) |
if (argc > 1 && curp.outtype <= OUTT_UTF8) |
ascii_sepline(curp.outdata); |
ascii_sepline(curp.outdata); |
} |
} |
Line 994 spawn_pager(void) |
|
Line 993 spawn_pager(void) |
|
|
|
/* Read all text right away and use the tag file. */ |
/* Read all text right away and use the tag file. */ |
|
|
if ((cmdlen = strlen(argv[0])) >= 4) { |
for (;;) { |
|
if ((cmdlen = strlen(argv[0])) < 4) |
|
break; |
cp = argv[0] + cmdlen - 4; |
cp = argv[0] + cmdlen - 4; |
if (strcmp(cp, "less") == 0 || |
if (strcmp(cp, "less") && strcmp(cp, "more")) |
strcmp(cp, "more") == 0) { |
break; |
tag_init(); |
if ((cp = tag_init()) == NULL) |
argv[argc++] = mandoc_strdup("+G1G"); |
break; |
argv[argc++] = mandoc_strdup("-T"); |
argv[argc++] = mandoc_strdup("+G1G"); |
argv[argc++] = tag_filename(); |
argv[argc++] = mandoc_strdup("-T"); |
} |
argv[argc++] = cp; |
|
break; |
} |
} |
argv[argc] = NULL; |
argv[argc] = NULL; |
|
|