mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Make sure the playlist directory exists before writing a playlist (#16085)
This commit is contained in:
parent
d7852d5db9
commit
8c58979d76
@ -1676,6 +1676,7 @@ void playlist_write_file(playlist_t *playlist)
|
||||
size_t i, len;
|
||||
intfstream_t *file = NULL;
|
||||
bool compressed = false;
|
||||
char dir_path[PATH_MAX_LENGTH];
|
||||
|
||||
/* Playlist will be written if any of the
|
||||
* following are true:
|
||||
@ -1692,6 +1693,11 @@ void playlist_write_file(playlist_t *playlist)
|
||||
(playlist->old_format != playlist->config.old_format)))
|
||||
return;
|
||||
|
||||
fill_pathname_basedir(dir_path, playlist->config.path, sizeof(dir_path));
|
||||
if (!path_is_directory(dir_path))
|
||||
if (!path_mkdir(dir_path))
|
||||
return;
|
||||
|
||||
#if defined(HAVE_ZLIB)
|
||||
if (playlist->config.compress)
|
||||
file = intfstream_open_rzip_file(playlist->config.path,
|
||||
|
Loading…
x
Reference in New Issue
Block a user