From e71312636be2c72d4266a10d42311e9a7d3b4620 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Sun, 30 Jan 2000 15:11:14 -0800
Subject: [PATCH] bugfix for isatty()

Rev: bin/install.pike:1.43
---
 bin/install.pike | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/install.pike b/bin/install.pike
index 475fefd9f0..ea8d341080 100644
--- a/bin/install.pike
+++ b/bin/install.pike
@@ -25,7 +25,7 @@ int istty()
     istty_cache=!!Stdio.stdin->tcgetattr();
     if(!istty_cache) istty_cache=-1;
   }
-  return istty_cache;
+  return istty_cache>0;
 #endif
 }
 
@@ -1144,6 +1144,7 @@ int main(int argc, string *argv)
 {
   foreach(Getopt.find_all_options(argv,aggregate(
     ({"help",Getopt.NO_ARG,({"-h","--help"})}),
+    ({"notty",Getopt.NO_ARG,({"-t","--notty"})}),
     ({"--interactive",Getopt.NO_ARG,({"-i","--interactive"})}),
     ({"--new-style",Getopt.NO_ARG,({"--new-style"})}),
     ({"--export",Getopt.NO_ARG,({"--export"})}),
@@ -1156,6 +1157,10 @@ int main(int argc, string *argv)
 	  werror(helptext);
 	  exit(0);
 
+	case "notty":
+	  istty_cache=-1;
+	  exit(0);
+
 	default:
 	  install_type=opt[0];
       }
-- 
GitLab