]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Call parse_long_options only if POSIXLY_CORRECT
authorJim Meyering <jim@meyering.net>
Wed, 17 Sep 1997 13:04:31 +0000 (13:04 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 17 Sep 1997 13:04:31 +0000 (13:04 +0000)
is *not* set.  Reported by Frank T Lofaro.

src/yes.c

index f88a14a108e9d85dc9497e6a91b2dcd194c139ad..d73b1938937453f74adf8e5844a60965a3b5bf06 100644 (file)
--- a/src/yes.c
+++ b/src/yes.c
@@ -55,7 +55,9 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
-  parse_long_options (argc, argv, "yes", GNU_PACKAGE, VERSION, usage);
+  /* Don't recognize --help or --version if POSIXLY_CORRECT is set.  */
+  if (getenv ("POSIXLY_CORRECT") == NULL)
+    parse_long_options (argc, argv, "yes", GNU_PACKAGE, VERSION, usage);
 
   if (argc == 1)
     while (1)