diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-03-13 16:26:33 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-03-15 12:48:33 -0400 |
commit | 56a862fded43b528eadc232d37a8684b48ef702c (patch) | |
tree | 2ee0b7417a8f16de396808aac7c7257e4b94f061 /diag.c | |
parent | 09558efdf0af09db73a4d16039a1e2718e7a58c5 (diff) | |
download | bfs-56a862fded43b528eadc232d37a8684b48ef702c.tar.xz |
diag: Make the -warn flag part of the cmdline
Diffstat (limited to 'diag.c')
-rw-r--r-- | diag.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -47,12 +47,14 @@ void bfs_verror(const struct cmdline *cmdline, const char *format, va_list args) } void bfs_vwarning(const struct cmdline *cmdline, const char *format, va_list args) { - int error = errno; + if (cmdline->warn) { + int error = errno; - bfs_warning_prefix(cmdline); + bfs_warning_prefix(cmdline); - errno = error; - cvfprintf(cmdline->cerr, format, args); + errno = error; + cvfprintf(cmdline->cerr, format, args); + } } void bfs_error_prefix(const struct cmdline *cmdline) { |