FS#12702: Fix illegal characters in suggested playlist filename

Issue had only been partially fixed in
3f3b738 by showing an error message

Change-Id: I91665ac826e0025fb80eadac31abffa03667cf62
This commit is contained in:
Christian Soffke 2025-01-09 12:18:34 +01:00
parent 24c9ccfac0
commit 2c4c1b9199
3 changed files with 4 additions and 2 deletions

View file

@ -443,6 +443,7 @@ bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
{
int result;
char playlist[MAX_PATH + 7]; /* room for /.m3u8\0*/
size_t basename_start;
if ((browser_status & CATBROWSE_PLAYLIST) == CATBROWSE_PLAYLIST)
return false;
@ -468,7 +469,10 @@ bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
".m3u8", 1 IF_CNFN_NUM_(, NULL));
else
{
basename_start = strlen(playlist) + 1;
strlcat(playlist, name, sizeof(playlist));
fix_path_part(playlist, basename_start,
sizeof(playlist) - 1 - basename_start) ;
apply_playlist_extension(playlist, sizeof(playlist));
}
}