mirror of
https://github.com/libretro/RetroArch
synced 2025-02-02 14:54:10 +00:00
Merge branch 'master' of https://github.com/libretro/RetroArch
This commit is contained in:
commit
343f1190ee
@ -125,14 +125,20 @@ void file_list_copy(file_list_t *list, file_list_t *list_old)
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
list_old->list[i].path = strdup(list->list[i].path);
|
||||
list_old->list[i].label = strdup(list->list[i].label);
|
||||
if (list->list[i].alt)
|
||||
list_old->list[i].alt = strdup(list->list[i].alt);
|
||||
list_old->list[i].path = NULL;
|
||||
list_old->list[i].label = NULL;
|
||||
list_old->list[i].alt = NULL;
|
||||
list_old->list[i].type = list->list[i].type;
|
||||
list_old->list[i].directory_ptr = list->list[i].directory_ptr;
|
||||
list_old->list[i].userdata = list->list[i].userdata;
|
||||
list_old->list[i].actiondata = list->list[i].actiondata;
|
||||
|
||||
if (list->list[i].path)
|
||||
list_old->list[i].path = strdup(list->list[i].path);
|
||||
if (list->list[i].label)
|
||||
list_old->list[i].label = strdup(list->list[i].label);
|
||||
if (list->list[i].alt)
|
||||
list_old->list[i].alt = strdup(list->list[i].alt);
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,21 +146,30 @@ void file_list_set_label_at_offset(file_list_t *list, size_t idx,
|
||||
const char *label)
|
||||
{
|
||||
free(list->list[idx].label);
|
||||
list->list[idx].alt = NULL;
|
||||
|
||||
if (label)
|
||||
list->list[idx].label = strdup(label);
|
||||
}
|
||||
|
||||
void file_list_get_label_at_offset(const file_list_t *list, size_t idx,
|
||||
const char **label)
|
||||
{
|
||||
if (label)
|
||||
*label = list->list[idx].label ?
|
||||
list->list[idx].label : list->list[idx].path;
|
||||
if (!label)
|
||||
return;
|
||||
|
||||
*label = list->list[idx].path;
|
||||
if (list->list[idx].label)
|
||||
*label = list->list[idx].label;
|
||||
}
|
||||
|
||||
void file_list_set_alt_at_offset(file_list_t *list, size_t idx,
|
||||
const char *alt)
|
||||
{
|
||||
free(list->list[idx].alt);
|
||||
list->list[idx].alt = NULL;
|
||||
|
||||
if (alt)
|
||||
list->list[idx].alt = strdup(alt);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user