From 6d56cce631e48732caccf0536e7a469e6b117c4c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 13 Aug 2014 05:12:35 +0200 Subject: [PATCH] (Retrolaunch) Add way to infer game name description --- tools/retrolaunch/main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/retrolaunch/main.c b/tools/retrolaunch/main.c index 8f62b2edc6..3fd426f4eb 100644 --- a/tools/retrolaunch/main.c +++ b/tools/retrolaunch/main.c @@ -83,6 +83,7 @@ find_rom_canonical_name(const char *hash, char *game_name, size_t max_len) close(fd); goto clean; } + close(fd); } rv = -1; @@ -394,7 +395,7 @@ int main(int argc, char *argv[]) { struct RunInfo info; int rv; - char game_name[MAX_TOKEN_LEN]; + char game_name[MAX_TOKEN_LEN], game_name_test[256]; char *path = argv[1]; if (argc < 2) @@ -411,6 +412,14 @@ int main(int argc, char *argv[]) } LOG_INFO("Game is `%s`", game_name); + char *substr = strrchr(game_name, '.'); + if (!substr) + *substr = '\0'; + else + { + substr = substr + 1; + LOG_INFO("Game description name is `%s`", substr); + } if ((rv = get_run_info(&info, game_name)) < 0) { LOG_WARN("Could not detect run info: %s", strerror(-rv));