From f372da253058bc6f16f39b84df785e5027ce2693 Mon Sep 17 00:00:00 2001 From: "David A. Wheeler" Date: Sat, 12 Jul 2014 11:31:45 -0400 Subject: [PATCH] Fix ignore directive when filenames differ (fix bug#6) - My thanks to Bernhard Herzog who provided the patch! --- flawfinder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flawfinder b/flawfinder index e5ec533..0a40514 100755 --- a/flawfinder +++ b/flawfinder @@ -1207,7 +1207,7 @@ def process_directive(): hitfound = 0 # Iterate backwards over hits, to be careful about the destructive iterator for i in xrange(len(hitlist)-1, -1, -1): - if hitlist[i].line == linenumber: + if hitlist[i].filename == filename and hitlist[i].line == linenumber: del hitlist[i] # DESTROY - this is a DESTRUCTIVE iterator. hitfound = 1 # Don't break, because there may be more than one. num_ignored_hits = num_ignored_hits + 1