]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Include "hard-locale.h".
authorJim Meyering <jim@meyering.net>
Tue, 15 Jun 2004 18:00:20 +0000 (18:00 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 15 Jun 2004 18:00:20 +0000 (18:00 +0000)
(main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since
POSIX specifies the behavior only in the POSIX locale.

src/pr.c

index 4492698c74d3395267458fecf9135fdbed5ecb4e..733ef62d8c17a4f29e27c6cc77e2f3356852bb6e 100644 (file)
--- a/src/pr.c
+++ b/src/pr.c
 #include <sys/types.h>
 #include "system.h"
 #include "error.h"
+#include "hard-locale.h"
 #include "mbswidth.h"
 #include "posixver.h"
 #include "xstrtol.h"
@@ -1074,8 +1075,8 @@ main (int argc, char **argv)
     }
 
   if (! date_format)
-    date_format = (getenv ("POSIXLY_CORRECT")
-                  ? dcgettext (NULL, "%b %e %H:%M %Y", LC_TIME)
+    date_format = (getenv ("POSIXLY_CORRECT") && !hard_locale (LC_TIME)
+                  ? "%b %e %H:%M %Y"
                   : "%Y-%m-%d %H:%M");
 
   /* Now we can set a reasonable initial value: */