Package: bsd-mailx / 8.1.2-0.20141216cvs-2

16-Stdin-not-a-tty.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: Robert Luberda <robert@debian.org>
Date: Tue, 18 Jun 2002 22:58:00 +0200
Subject: 16 Stdin not a tty.

Return from grabh() if stdin is not a terminal.
This fixes the `-I' option (closes: #149005).
---
 tty.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tty.c b/tty.c
index 1942814..5ab6712 100644
--- a/tty.c
+++ b/tty.c
@@ -70,6 +70,10 @@ grabh(struct header *hp, int gflags)
 	char *s;
 	int error;
 
+	/* do nothing if not on tty, see Debian Bug #149005 */
+	if (!isatty(0))
+	    return 0;
+
 	sigemptyset(&act.sa_mask);
 	act.sa_flags = SA_RESTART;
 	act.sa_handler = SIG_DFL;