Do not add empty matches to matches_all.

This commit is contained in:
tastytea 2021-06-01 20:15:05 +02:00
parent 21989aabfe
commit 6a4511099f
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -150,9 +150,12 @@ int main(int argc, char *argv[])
{ {
auto matches{ auto matches{
search::search(filepath, regex, search_settings)}; search::search(filepath, regex, search_settings)};
if (!matches.empty())
{
std::lock_guard<std::mutex> guard(mutex_matches_all); std::lock_guard<std::mutex> guard(mutex_matches_all);
matches_all.emplace_back(matches); matches_all.emplace_back(matches);
} }
}
catch (const zip::exception &e) catch (const zip::exception &e)
{ {
if (opts.ignore_archive_errors && e.code == 1) if (opts.ignore_archive_errors && e.code == 1)