summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/menus/playlist_menu.c2
-rw-r--r--apps/playlist_catalog.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/apps/menus/playlist_menu.c b/apps/menus/playlist_menu.c
index 175ca19959..2de73415b2 100644
--- a/apps/menus/playlist_menu.c
+++ b/apps/menus/playlist_menu.c
@@ -50,7 +50,7 @@ int save_playlist_screen(struct playlist_info* playlist)
if (!dot)
{
/* folder of some type */
- if (temp[1] != '\0')
+ if (len > 1)
strcpy(&temp[len-1], ".m3u8");
else
snprintf(temp, sizeof(temp), "%s%s",
diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c
index 3d524998b2..2147ea990c 100644
--- a/apps/playlist_catalog.c
+++ b/apps/playlist_catalog.c
@@ -86,6 +86,10 @@ static int initialize_catalog(void)
mkdir(playlist_dir);
}
+ /* remove duplicate leading '/' */
+ if (playlist_dir[0] == '/' && playlist_dir[1] == '/')
+ strcpy(playlist_dir, &playlist_dir[1]);
+
playlist_dir_length = strlen(playlist_dir);
if (dir_exists(playlist_dir))