From b4db8b086110d9a4e62f02ec40240b9a8cf607ff Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 9 Oct 2020 23:48:56 +0200 Subject: [PATCH] Full scans (not trigram-based) would always print counts, even without -c. Fix. --- plocate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plocate.cpp b/plocate.cpp index e219db0..f07b687 100644 --- a/plocate.cpp +++ b/plocate.cpp @@ -369,7 +369,9 @@ void do_search_file(const vector &needles, const char *filename) // the pattern and done a union of them, but that's a lot of // work for fairly unclear gain.) uint64_t matched = scan_all_docids(needles, fd, corpus, &engine); - printf("%zu\n", matched); + if (only_count) { + printf("%zu\n", matched); + } return; } sort(trigrams.begin(), trigrams.end()); -- 2.39.2