summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ls.c b/src/ls.c
index 67e372370..ec051c29d 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -825,7 +825,7 @@ decode_switches (int argc, char **argv)
quote_as_string = 0;
line_length = 80;
- if ((p = getenv ("COLUMNS")))
+ if ((p = getenv ("COLUMNS")) && *p)
{
if (xstrtol (p, NULL, 0, &tmp_long, NULL) == LONGINT_OK
&& 0 < tmp_long && tmp_long <= INT_MAX)