mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
menu_content_load_from_playlist - use path_is_valid
This commit is contained in:
parent
9cff56ea62
commit
3dc40263ea
@ -16,6 +16,7 @@
|
|||||||
#include <retro_assert.h>
|
#include <retro_assert.h>
|
||||||
#include <streams/file_stream.h>
|
#include <streams/file_stream.h>
|
||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
|
#include <retro_stat.h>
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
|
|
||||||
#include "menu_content.h"
|
#include "menu_content.h"
|
||||||
@ -162,7 +163,7 @@ static bool menu_content_load_from_playlist(void *data)
|
|||||||
if (path && !string_is_empty(path))
|
if (path && !string_is_empty(path))
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
RFILE *fp = NULL;
|
bool valid_path = false;
|
||||||
char *path_check = NULL;
|
char *path_check = NULL;
|
||||||
char *path_tolower = strdup(path);
|
char *path_tolower = strdup(path);
|
||||||
|
|
||||||
@ -179,16 +180,13 @@ static bool menu_content_load_from_playlist(void *data)
|
|||||||
|
|
||||||
strncpy(path_check, path, strlen(path_tolower));
|
strncpy(path_check, path, strlen(path_tolower));
|
||||||
|
|
||||||
|
valid_path = path_is_valid(path_check);
|
||||||
|
|
||||||
free(path_tolower);
|
free(path_tolower);
|
||||||
|
|
||||||
fp = filestream_open(path_check, RFILE_MODE_READ, -1);
|
|
||||||
|
|
||||||
free(path_check);
|
free(path_check);
|
||||||
|
|
||||||
if (!fp)
|
if (!valid_path)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
filestream_close(fp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path);
|
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user