do not start pager when not on a tty.

This commit is contained in:
Nikos Mavrogiannopoulos
2014-01-10 08:38:49 +01:00
parent b09dd7d2e4
commit 8c5d29dd1a
2 changed files with 6 additions and 1 deletions

View File

@@ -114,7 +114,7 @@ AC_CHECK_MEMBER([struct sockaddr.sa_len],
AC_CHECK_HEADERS([net/if_tun.h linux/if_tun.h netinet/in_systm.h], [], [], [])
AC_CHECK_FUNCS([setproctitle clock_gettime])
AC_CHECK_FUNCS([setproctitle clock_gettime isatty])
if [ test -z "$LIBWRAP" ];then
libwrap_enabled="no"

View File

@@ -45,6 +45,11 @@ FILE* pager_start(void)
{
FILE *fp;
#ifdef HAVE_ISATTY
if (isatty(STDOUT_FILENO) == 0)
return stdout;
#endif
if (!getenv("LESS")) {
setenv("LESS", "FRSX", 1);
}