summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/eval.c2
-rw-r--r--tests/bfs/warn_without_noerror.sh2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 7fae8fc..b277d1f 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1751,7 +1751,7 @@ int bfs_eval(struct bfs_ctx *ctx) {
sigunhook(info_hook);
bfs_bar_hide(args.bar);
- if (args.nerrors > 0) {
+ if (ctx->ignore_errors && args.nerrors > 0) {
bfs_warning(ctx, "Suppressed errors: %zu\n", args.nerrors);
}
diff --git a/tests/bfs/warn_without_noerror.sh b/tests/bfs/warn_without_noerror.sh
new file mode 100644
index 0000000..5167309
--- /dev/null
+++ b/tests/bfs/warn_without_noerror.sh
@@ -0,0 +1,2 @@
+# bfs shouldn't print "warning: Suppressed errors" without -noerror
+! invoke_bfs inaccessible -warn 2>&1 >/dev/null | grep warning >&2