summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ls.c b/src/ls.c
index 8b524d954..5f56e857e 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -727,8 +727,10 @@ decode_switches (int argc, char **argv)
}
#endif
+ /* TABSIZE is not POSIX-approved.
+ Ignore it when POSIXLY_CORRECT is set. */
tabsize = 8;
- if (!posix_pedantic && (p = getenv ("TABSIZE")))
+ if (getenv ("POSIXLY_CORRECT") == 0 && (p = getenv ("TABSIZE")))
{
if (xstrtol (p, NULL, 0, &tmp_long, NULL) == LONGINT_OK
&& 0 < tmp_long && tmp_long <= INT_MAX)