summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class3
1 files changed, 2 insertions, 1 deletions
diff --git a/it.class b/it.class
index 0d3cdec..45cc2cb 100644
--- a/it.class
+++ b/it.class
@@ -929,7 +929,8 @@ static function getopt($usage, $p = array())
it::error("Optional arguments passed to script without optional args in usage"); # FIXME 2020-10 NG merge with normal usage errors below
if ($err || $eat || $result['h'] || $result['help'] || $mandatoryargs)
{
- fputs(($result['h'] || $result['help'] ? STDOUT : STDERR), trim($usage) . "\n");
+ if (is_resource($out = $result['h'] || $result['help'] ? STDOUT : STDERR))
+ fputs($out, trim($usage) . "\n");
return $p['noexit'] ? false : exit(1);
}