summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-03-15 13:13:54 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-03-15 13:13:54 -0400
commit5ea7f4ea1f5015290b90bc51e503298aeef6cfb5 (patch)
treea4cefa12bfa027539f02919785f54a3312e25273 /parse.c
parent10975c723ed0c5a6764fda3d4f539a36033dcb0d (diff)
downloadbfs-5ea7f4ea1f5015290b90bc51e503298aeef6cfb5.tar.xz
parse: Don't warn if POSIXLY_CORRECT is set
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 7c132b0..f68eaf2 100644
--- a/parse.c
+++ b/parse.c
@@ -3533,11 +3533,13 @@ struct cmdline *parse_cmdline(int argc, char *argv[]) {
}
bool stdin_tty = isatty(STDIN_FILENO);
- cmdline->warn = stdin_tty;
-
bool stdout_tty = isatty(STDOUT_FILENO);
bool stderr_tty = isatty(STDERR_FILENO);
+ if (!getenv("POSIXLY_CORRECT")) {
+ cmdline->warn = stdin_tty;
+ }
+
struct parser_state state = {
.cmdline = cmdline,
.argv = cmdline->argv + 1,