summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2018-10-14 15:14:06 -0400
committerJakob Kaivo <jkk@ung.org>2018-10-14 15:14:06 -0400
commit3e760d7b730e119fe2ca29e29de86daad2065bb1 (patch)
treea01dce3418d5b7033691a406ca1fe4c32f6b08ce
parente91f71c43b79667e9cf73aeef73e028ac16c515b (diff)
handle zero lines of ls output properly (empty dirs, errors)HEADmaster
-rwxr-xr-xcolor-ls4
1 files changed, 3 insertions, 1 deletions
diff --git a/color-ls b/color-ls
index fe24deb..45cb0c2 100755
--- a/color-ls
+++ b/color-ls
@@ -121,7 +121,9 @@ function comma_output() {
}
END {
- if (output == "x") {
+ if (NR == 0) {
+ # do nothing
+ } else if (output == "x") {
row_output();
} else if (output == "C") {
columns_output();