Don't print multiple matches for the same file.

This commit is contained in:
Michael Herzberg 2019-03-01 14:46:43 +00:00
parent 8903d6c896
commit 717a35e7c8
1 changed files with 16 additions and 14 deletions

View File

@ -132,9 +132,11 @@ def handle_extid(conf, extid, csvwriter):
file_matches = []
if zipentry.filename.endswith(".js"):
with zf.open(zipentry) as f:
verbatim_lines = []
joined_string_lines = []
for block in mince_js(io.TextIOWrapper(f, encoding="utf-8", errors="surrogateescape")):
verbatim_lines = block.content.splitlines()
joined_string_lines = "".join(map(lambda x: x[1], block.string_literals)).splitlines()
verbatim_lines += block.content.splitlines()
joined_string_lines += "".join(map(lambda x: x[1], block.string_literals)).splitlines()
for search_tag in miner_strings.strings.keys():
for search_string in miner_strings.strings[search_tag]: