diff options
author | Karel Zak | 2013-01-24 19:27:12 +0100 |
---|---|---|
committer | Karel Zak | 2013-01-24 19:27:12 +0100 |
commit | 951666e9f337974a5ffa5097b5613881a23ddd47 (patch) | |
tree | 9ae8c56511a08fb06ad8e3d837b99797fc805803 /text-utils/more.c | |
parent | build-sys: add --disable-{more,ul,pg} (diff) | |
download | kernel-qcow2-util-linux-951666e9f337974a5ffa5097b5613881a23ddd47.tar.gz kernel-qcow2-util-linux-951666e9f337974a5ffa5097b5613881a23ddd47.tar.xz kernel-qcow2-util-linux-951666e9f337974a5ffa5097b5613881a23ddd47.zip |
more: allow to compile as non-interactive test_more program
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils/more.c')
-rw-r--r-- | text-utils/more.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/text-utils/more.c b/text-utils/more.c index 41caeb194..f0b0f67db 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -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); |