summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-03-09 08:46:50 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-03-09 08:57:56 -0500
commitec6de1ebefe65f9a4be0edafeda3d6caeea1442d (patch)
tree07dbed5ded391be0e3deb754676238188ee1b7b1
parent050fedea006f8e03f7d9f55fef7d6fee35c622b6 (diff)
downloadbfs-ec6de1ebefe65f9a4be0edafeda3d6caeea1442d.tar.xz
ctx: Don't include std{out,err} in the open file count
-rw-r--r--ctx.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ctx.c b/ctx.c
index 7f4fa03..236094c 100644
--- a/ctx.c
+++ b/ctx.c
@@ -189,7 +189,11 @@ CFILE *bfs_ctx_dedup(struct bfs_ctx *ctx, CFILE *cfile, const char *path) {
ctx_file->cfile = cfile;
ctx_file->path = path;
- ++ctx->nfiles;
+
+ if (cfile != ctx->cout && cfile != ctx->cerr) {
+ ++ctx->nfiles;
+ }
+
return cfile;
}