From 8d4cff2539ff117d5ea4616b27ef7de2aa400bd4 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 6 Nov 2018 14:13:31 +0100 Subject: ::fatal should not send mail if only stdout is not a tty, ::bail adds newlines --- it.class | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/it.class b/it.class index 9ff426e..4f6514a 100644 --- a/it.class +++ b/it.class @@ -201,7 +201,7 @@ static function error($p = array()) return; } - $toscreen = getenv('NOERRORMAILS') || ini_get('display_errors') || (defined("STDOUT") && posix_isatty(STDOUT)) || EDC('astwin') || EDC('asdevel'); + $toscreen = getenv('NOERRORMAILS') || ini_get('display_errors') || (defined("STDOUT") && posix_isatty(STDERR)) || EDC('astwin') || EDC('asdevel'); if ($toscreen && !it::is_live()) $GLOBALS['debug_noredir'] = 1; @@ -318,9 +318,9 @@ static function fatal($p) /** * Print message to stderr and exit with error code */ -static function bail($message = "Bailed.\n") +static function bail($message = "Bailed.") { - fputs(STDERR, $message); + fputs(STDERR, rtrim($message, "\n") . "\n"); exit(1); } -- cgit v1.2.3