From: Steinar H. Gunderson Date: Fri, 9 Oct 2020 21:48:56 +0000 (+0200) Subject: Full scans (not trigram-based) would always print counts, even without -c. Fix. X-Git-Tag: 1.0.0~22 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b4db8b086110d9a4e62f02ec40240b9a8cf607ff;p=plocate Full scans (not trigram-based) would always print counts, even without -c. Fix. --- 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());