7a958a
From 58e1af6ca75d035b6391708be2c2272bb8d04620 Mon Sep 17 00:00:00 2001
7a958a
From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <ondrej@sury.org>
7a958a
Date: Sun, 4 Nov 2018 02:20:41 +0700
7a958a
Subject: [PATCH] Enable IDN processing (both idnin and idnout) only on tty,
7a958a
 disable it when the stdout is not a tty
7a958a
7a958a
(cherry picked from commit 0e1bf7d017e4f6d787cbeb72cc2aa74e7f30122e)
7a958a
(cherry picked from commit 8e1cc95c943b7dfaaaaf2d9a4971861735cc3fb2)
7a958a
---
7a958a
 bin/dig/dighost.c | 2 +-
7a958a
 1 file changed, 1 insertion(+), 1 deletion(-)
7a958a
7a958a
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
7a958a
index 74791d671e..3b722ba0ff 100644
7a958a
--- a/bin/dig/dighost.c
7a958a
+++ b/bin/dig/dighost.c
7a958a
@@ -825,7 +825,7 @@ make_empty_lookup(void) {
7a958a
 	looknew->seenbadcookie = false;
7a958a
 	looknew->badcookie = true;
7a958a
 #ifdef WITH_IDN_SUPPORT
7a958a
-	looknew->idnin = (getenv("IDN_DISABLE") == NULL);
7a958a
+	looknew->idnin = isatty(1)?(getenv("IDN_DISABLE") == NULL):false;
7a958a
 	if (looknew->idnin) {
7a958a
 		const char *charset = getenv("CHARSET");
7a958a
 		if (charset && !strcmp(charset, "ASCII"))
7a958a
-- 
7a958a
2.20.1
7a958a