]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(decode_switches): Pay attention to TABSIZE even if POSIXLY_CORRECT
authorJim Meyering <jim@meyering.net>
Tue, 15 Jun 2004 18:00:03 +0000 (18:00 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 15 Jun 2004 18:00:03 +0000 (18:00 +0000)
is set.  POSIX reserves upper-case environment variables to the
implementation, so it's OK for ls to depend on TABSIZE.

src/ls.c

index 81f0d2ee69335284e573de4322d622ea73d085ba..b986e68c1489d58a42ef8bf8c1c429b59af8faa2 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -1416,12 +1416,10 @@ decode_switches (int argc, char **argv)
   }
 #endif
 
-  /* Using the TABSIZE environment variable is not POSIX-approved.
-     Ignore it when POSIXLY_CORRECT is set.  */
   {
-    char const *p;
+    char const *p = getenv ("TABSIZE");
     tabsize = 8;
-    if (!getenv ("POSIXLY_CORRECT") && (p = getenv ("TABSIZE")))
+    if (p)
       {
        unsigned long int tmp_ulong;
        if (xstrtoul (p, NULL, 0, &tmp_ulong, NULL) == LONGINT_OK