From d3bbdb2e068073584c9e2ca1fe950ae1fb796a44 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 14 Apr 2018 14:09:46 -0400 Subject: [PATCH] libretro-db: Show missing key match warning once Before, the "missing match" warning would appear for every entry. This change makes it show that it only displays the warning once. --- libretro-db/c_converter.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libretro-db/c_converter.c b/libretro-db/c_converter.c index f08171ca17..564c43fa53 100644 --- a/libretro-db/c_converter.c +++ b/libretro-db/c_converter.c @@ -494,6 +494,7 @@ static dat_converter_list_t* dat_converter_parser( dat_converter_map_t map; dat_converter_list_item_t* current = lexer_list->values; bool skip = true; + bool warning_displayed = false; map.key = NULL; map.type = DAT_CONVERTER_LIST_MAP; @@ -531,13 +532,16 @@ static dat_converter_list_t* dat_converter_parser( // If the key is not found, report, and mark it to be skipped. if (!map.key) { - printf("Missing match key '"); - while (match_key->next) - { - printf("%s.", match_key->value); - match_key = match_key->next; + if (warning_displayed == false) { + printf(" - Missing match key '"); + while (match_key->next) + { + printf("%s.", match_key->value); + match_key = match_key->next; + } + printf("%s' on line %d\n", match_key->value, current->token.line_no); + warning_displayed = true; } - printf("%s' on line %d\n", match_key->value, current->token.line_no); skip = true; } }