aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-02 23:56:24 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-02 23:56:55 +1300
commit0bec8226208ae00341bd441ddc8008732683356b (patch)
tree11d161650d29284f19fe2f0af1875ce6f236a222 /bin
parentUpdate submodules (diff)
downloaddotfiles-0bec8226208ae00341bd441ddc8008732683356b.tar.gz
dotfiles-0bec8226208ae00341bd441ddc8008732683356b.zip
Color compatibility fixes for tlcs(1df)
NetBSD sh(1) doesn't like unassigned variables in arithmetic expressions
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tlcs5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/tlcs b/bin/tlcs
index 4e101201..aa0d2f25 100755
--- a/bin/tlcs
+++ b/bin/tlcs
@@ -35,12 +35,13 @@ if [ "$#" -eq 0 ] ; then
fi
# If color was requested for the output, try and get a count of available
-# colors
+# colors; otherwise default to zero
[ -n "$color" ] && color_count=$( {
tput colors || tput Co
} 2>/dev/null )
+: "${color_count:=0}"
-# If the color count is greater than 7, we'll color the output
+# If the color count is 8 or greater, we'll color the output
if [ "$((color_count >= 8))" -eq 1 ] ; then
# Color code for resetting