From 773d412665d93334f19b76cda0c5e9ff836d7278 Mon Sep 17 00:00:00 2001
From: William Roberts <william.c.roberts@intel.com>
Date: Thu, 11 Jun 2015 17:09:25 -0700
Subject: [PATCH] check_seapp: Correct output on duplicate entries

If a duplicate entry is found, rule_map_cmp() incorrectly
assumes that the lengths of the key value pairs should be
equal, when this is not true. The duplicate detection is
done on the input parameters, thus the lengths can be
different. This resulted in a duplicate error string
message of "do not match", instead of "match on all inputs".

Also, the file name printed that contained the error was
the output file, not the input file that contained it.

Change-Id: I9b3f99fa4aa3454849de55f18b198b0b56e44320
Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
 tools/check_seapp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/check_seapp.c b/tools/check_seapp.c
index d5d15b03f..d40b6b082 100644
--- a/tools/check_seapp.c
+++ b/tools/check_seapp.c
@@ -347,9 +347,6 @@ static map_match rule_map_cmp(rule_map *rmA, rule_map *rmB) {
 	key_map *mA;
 	key_map *mB;
 
-	if (rmA->length != rmB->length)
-		return map_no_matches;
-
 	for (i = 0; i < rmA->length; i++) {
 		mA = &(rmA->m[i]);
 
@@ -818,7 +815,7 @@ static void rule_add(rule_map *rm) {
 		cmp = rule_map_cmp(rm, tmp->r);
 		log_error("Duplicate line detected in file: %s\n"
 			  "Lines %d and %d %s!\n",
-			  out_file_name, tmp->r->lineno, rm->lineno,
+			  in_file_name, tmp->r->lineno, rm->lineno,
 			  map_match_str[cmp]);
 		rule_map_free(rm, rule_map_destroy_key);
 		goto err;
-- 
GitLab