Simplify string_list_new_special
This commit is contained in:
parent
91aa8034b1
commit
db99fe098d
17
retroarch.c
17
retroarch.c
|
@ -2155,8 +2155,7 @@ struct string_list *dir_list_new_special(const char *input_dir,
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct string_list *string_list_new_special(
|
static struct string_list *string_list_new_special(
|
||||||
enum string_list_type type,
|
enum string_list_type type, unsigned *len)
|
||||||
void *data, unsigned *len, size_t *list_size)
|
|
||||||
{
|
{
|
||||||
union string_list_elem_attr attr;
|
union string_list_elem_attr attr;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
@ -2382,17 +2381,13 @@ error:
|
||||||
const char *char_list_new_special(enum string_list_type type, void *data)
|
const char *char_list_new_special(enum string_list_type type, void *data)
|
||||||
{
|
{
|
||||||
unsigned len = 0;
|
unsigned len = 0;
|
||||||
size_t list_size;
|
struct string_list *s = string_list_new_special(type, &len);
|
||||||
struct string_list *s = string_list_new_special(type, data, &len, &list_size);
|
char *opt = (len > 0) ? (char*)calloc(len, sizeof(char)): NULL;
|
||||||
char *options = (len > 0) ? (char*)calloc(len, sizeof(char)): NULL;
|
if (opt && s)
|
||||||
|
string_list_join_concat(opt, len, s, "|");
|
||||||
if (options && s)
|
|
||||||
string_list_join_concat(options, len, s, "|");
|
|
||||||
|
|
||||||
string_list_free(s);
|
string_list_free(s);
|
||||||
s = NULL;
|
s = NULL;
|
||||||
|
return opt;
|
||||||
return options;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *path_get_ptr(enum rarch_path_type type)
|
char *path_get_ptr(enum rarch_path_type type)
|
||||||
|
|
Loading…
Reference in New Issue