mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Do not error out when finding file without ext.
This commit is contained in:
parent
90bd020595
commit
8abaebde6f
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
static int find_hash(int fd, const char *hash, char *game_name, size_t max_len)
|
static int find_hash(int fd, const char *hash, char *game_name, size_t max_len)
|
||||||
{
|
{
|
||||||
char token[MAX_TOKEN_LEN];
|
char token[MAX_TOKEN_LEN] = {0};
|
||||||
while (1) {
|
while (1) {
|
||||||
if (find_token(fd, "game") < 0) {
|
if (find_token(fd, "game") < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -71,11 +71,12 @@ find_rom_canonical_name(const char *hash, char *game_name, size_t max_len)
|
|||||||
for (i = 0; i < files->size; i++) {
|
for (i = 0; i < files->size; i++) {
|
||||||
dat_path = files->elems[i].data;
|
dat_path = files->elems[i].data;
|
||||||
dat_name = basename(dat_path);
|
dat_name = basename(dat_path);
|
||||||
|
|
||||||
dat_name_dot = strchr(dat_name, '.');
|
dat_name_dot = strchr(dat_name, '.');
|
||||||
if (!dat_name_dot) {
|
if (!dat_name_dot) {
|
||||||
rv = -1;
|
continue;
|
||||||
goto clean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
offs = dat_name_dot - dat_name + 1;
|
offs = dat_name_dot - dat_name + 1;
|
||||||
memcpy(game_name, dat_name, offs);
|
memcpy(game_name, dat_name, offs);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user