more: allow to compile as non-interactive test_more program

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2013-01-24 19:27:12 +01:00
parent 53b22add73
commit 951666e9f3
2 changed files with 13 additions and 0 deletions

View File

@ -87,5 +87,11 @@ else
more_LDADD += -ltermcap
endif
endif
check_PROGRAMS += test_more
test_more_SOURCES = $(more_SOURCES)
test_more_CFLAGS = -DTEST_PROGRAM
test_more_LDADD = $(more_LDADD)
endif # BUILD_MORE

View File

@ -68,6 +68,10 @@
#include <regex.h>
#ifdef TEST_PROGRAM
# define NON_INTERACTIVE_MORE 1
#endif
#ifndef XTABS
# define XTABS TAB3
#endif
@ -1759,7 +1763,10 @@ void initterm(void)
#ifdef do_SIGTTOU
retry:
#endif
#ifndef NON_INTERACTIVE_MORE
no_tty = tcgetattr(fileno(stdout), &otty);
#endif
if (!no_tty) {
docrterase = (otty.c_cc[VERASE] != 255);
docrtkill = (otty.c_cc[VKILL] != 255);