summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-03-06 10:18:58 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-03-06 10:18:58 +0000
commit707f69604fa6ce05365bbcc9ba15113a812d801f (patch)
treec4fe6acf256a78e71673fbcb229ba3077242a017 /main.c
parent41a7c857dd99f9a71bb60680e0cbc651feec8808 (diff)
downloadmandoc-707f69604fa6ce05365bbcc9ba15113a812d801f.tar.gz
autoconfiguration test whether less(1) supports the -T option;
needed for Alpine Linux because it uses busybox less(1) by default; based on a patch from Daniel Sabogal explained to me by Natanael Copa
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index 810129e8..0f98a5fc 100644
--- a/main.c
+++ b/main.c
@@ -1161,7 +1161,9 @@ spawn_pager(struct tag_files *tag_files)
char *argv[MAX_PAGER_ARGS];
const char *pager;
char *cp;
+#if HAVE_LESS_T
size_t cmdlen;
+#endif
int argc, use_ofn;
pid_t pager_pid;
@@ -1193,6 +1195,7 @@ spawn_pager(struct tag_files *tag_files)
/* For less(1), use the tag file. */
use_ofn = 1;
+#if HAVE_LESS_T
if ((cmdlen = strlen(argv[0])) >= 4) {
cp = argv[0] + cmdlen - 4;
if (strcmp(cp, "less") == 0) {
@@ -1205,6 +1208,7 @@ spawn_pager(struct tag_files *tag_files)
}
}
}
+#endif
if (use_ofn)
argv[argc++] = tag_files->ofn;
argv[argc] = NULL;