diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/printf.c | 4 | ||||
-rw-r--r-- | src/test.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/printf.c b/src/printf.c index 526e68ca6..59b5801eb 100644 --- a/src/printf.c +++ b/src/printf.c @@ -137,7 +137,9 @@ main (int argc, char **argv) exit_status = 0; - parse_long_options (argc, argv, "printf", PACKAGE_VERSION, usage); + /* Don't recognize --help or --version if POSIXLY_CORRECT is set. */ + if (getenv ("POSIXLY_CORRECT") == NULL) + parse_long_options (argc, argv, "printf", PACKAGE_VERSION, usage); if (argc == 1) { diff --git a/src/test.c b/src/test.c index e124ed51b..bb0ae00b1 100644 --- a/src/test.c +++ b/src/test.c @@ -1073,7 +1073,9 @@ main (int margc, char **margv) if (margv[0] && strcmp (margv[0], "[") == 0) { - parse_long_options (argc, argv, COMMAND_NAME, PACKAGE_VERSION, usage); + /* Don't recognize --help or --version if POSIXLY_CORRECT is set. */ + if (getenv ("POSIXLY_CORRECT") == NULL) + parse_long_options (argc, argv, COMMAND_NAME, PACKAGE_VERSION, usage); --margc; |