diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2021-03-17 11:05:02 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2021-03-17 11:05:02 (EDT) |
commit | 2657bc0019a6840c90f3daa090c7101e5c7997d1 (patch) | |
tree | 7f827f272c3f3a54bb262d855d8c725489c6dbe4 | |
parent | aaa24157f390ae5ec0a3d8ce221faba2db903cb1 (diff) | |
download | dodge-balls-2657bc0019a6840c90f3daa090c7101e5c7997d1.zip dodge-balls-2657bc0019a6840c90f3daa090c7101e5c7997d1.tar.gz dodge-balls-2657bc0019a6840c90f3daa090c7101e5c7997d1.tar.bz2 |
game: Save best locale match
-rw-r--r-- | src/game.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -217,6 +217,7 @@ _db_game_xml_game_el_start(void *pv, const char *name, const char **attr) XML_Parser p; struct db_game *game; char *lang; + int match; db_dbg(" <%s> (game child)", name); @@ -230,7 +231,9 @@ _db_game_xml_game_el_start(void *pv, const char *name, const char **attr) return; } db_dbg(" lang=\"%s\"", lang); - if (db_locale_match(lang) > game->best_name_match) { + match = db_locale_match(lang); + if (match > game->best_name_match) { + game->best_name_match = match; goto name_ok; } db_xml_node_push(p, game, _db_game_xml_invalid_start, @@ -255,7 +258,9 @@ _db_game_xml_game_el_start(void *pv, const char *name, const char **attr) return; } db_dbg(" lang=\"%s\"", lang); - if (db_locale_match(lang) > game->best_desc_match) { + match = db_locale_match(lang); + if (match > game->best_desc_match) { + game->best_name_match = match; goto desc_ok; } db_xml_node_push(p, game, _db_game_xml_invalid_start, |