summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2015-07-22 08:15:18 +0100
committerTim Angus <tim@ngus.net>2016-04-07 11:02:31 +0100
commit78d3929f526d06b1879c565ed08b337ba6138cae (patch)
tree8193c6397b8ea1dfac3e983664c604c39a719560 /Makefile
parentf0e19948fe871198ea9c049f721ab2caf458bcb7 (diff)
build: if tput fails, fall back to a reasonable text width
If TERM is not set (which can happen in autobuilders and other batch environments), or if tput cannot determine the number of columns for some other reason, then it can fail and not produce any output. Prior to this change, that would result in passing field width -4 to fmt, which is an error and causes fmt to produce no output.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 83431fdc..408909f3 100644
--- a/Makefile
+++ b/Makefile
@@ -1179,7 +1179,7 @@ ifeq ($(BUILD_MASTER_SERVER),1)
endif
ifneq ($(call bin_path, tput),)
- TERM_COLUMNS=$(shell echo $$((`tput cols`-4)))
+ TERM_COLUMNS=$(shell if c=`tput cols`; then echo $$(($$c-4)); else echo 76; fi)
else
TERM_COLUMNS=76
endif