This commit is contained in:
libretroadmin 2024-12-18 20:15:58 +01:00
parent 47709fe0d5
commit 4521f6bcb2
3 changed files with 11 additions and 4 deletions

View File

@ -2328,7 +2328,9 @@ bool video_shader_load_preset_into_shader(const char *path,
#endif
/* Gather all the paths of all of the presets in all reference chains */
override_paths_list = path_linked_list_new();
override_paths_list = (struct path_linked_list*)malloc(sizeof(*override_paths_list));
override_paths_list->next = NULL;
override_paths_list->path = NULL;
video_shader_gather_reference_path_list(override_paths_list, conf->path, 0);
/*

View File

@ -413,7 +413,11 @@ size_t config_file_add_reference(config_file_t *conf, char *path)
/* It is expected that the conf has it's path already set */
char short_path[NAME_MAX_LENGTH];
if (!conf->references)
conf->references = path_linked_list_new();
{
conf->references = (struct path_linked_list*)malloc(sizeof(*conf->references));
conf->references->next = NULL;
conf->references->path = NULL;
}
len = fill_pathname_abbreviated_or_relative(short_path, conf->path, path, sizeof(short_path));
path_linked_list_add_path(conf->references, short_path);
return len;

View File

@ -358,7 +358,8 @@ char *find_last_slash(const char *str)
{
const char *slash = strrchr(str, '/');
const char *backslash = strrchr(str, '\\');
return (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash;
char *last_slash = (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash;
return last_slash;
}
/**
@ -374,7 +375,7 @@ size_t fill_pathname_slash(char *path, size_t size)
size_t path_len;
const char *slash = strrchr(path, '/');
const char *backslash = strrchr(path, '\\');
const char *last_slash = (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash;
char *last_slash = (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash;
if (!last_slash)
return strlcat(path, PATH_DEFAULT_SLASH(), size);
path_len = strlen(path);