Merge pull request #5038 from RobLoach/patch-11

[DB] Update RDB building to ignore missing keys
This commit is contained in:
Twinaphex 2017-06-07 19:54:00 +02:00 committed by GitHub
commit c7036b24d4

View File

@ -527,23 +527,27 @@ static dat_converter_list_t* dat_converter_parser(
if (match_key)
{
map.key = dat_converter_get_match(map.value.list, match_key);
// If the key is not found, report, and mark it to be skipped.
if (!map.key)
{
printf("missing match key '");
printf("Missing match key '");
while (match_key->next)
{
printf("%s.", match_key->value);
match_key = match_key->next;
}
printf("%s' in one of the entries\n", match_key->value);
dat_converter_exit(1);
printf("%s' on line %d\n", match_key->value, current->token.line_no);
skip = true;
}
}
else
map.key = NULL;
dat_converter_list_append(target, &map);
skip = true;
// If we are still not to skip the entry, append it to the list.
if (!skip) {
dat_converter_list_append(target, &map);
skip = true;
}
}
else
dat_converter_list_free(map.value.list);
@ -833,4 +837,3 @@ int main(int argc, char** argv)
return 0;
}