From fe00906abb355a40888e7a2ce785ddfe3cfc525f Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 29 Mar 2024 16:09:56 -0400 Subject: pathfuncs.c add path_strip_leading_separators() added to path_append as well Change-Id: Ieb6ec4f4c475ca5e60c8246c7f044bcc7651f6bf --- apps/playlist_catalog.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'apps/playlist_catalog.c') diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c index 1bd4b7ee13..bcca406494 100644 --- a/apps/playlist_catalog.c +++ b/apps/playlist_catalog.c @@ -70,7 +70,7 @@ static int browser_status = CATBROWSE_NOTHING; static size_t get_directory(char* dirbuf, size_t dirbuf_sz) { - char *pl_dir = PLAYLIST_CATALOG_DEFAULT_DIR; + const char *pl_dir = PLAYLIST_CATALOG_DEFAULT_DIR; /* directory config is of the format: "dir: /path/to/dir" */ if (global_settings.playlist_catalog_dir[0] != '\0') @@ -79,10 +79,7 @@ static size_t get_directory(char* dirbuf, size_t dirbuf_sz) } /* remove duplicate leading '/' */ - if (pl_dir[0] == '/' && pl_dir[1] == '/') - { - pl_dir++; - } + path_strip_leading_separators(pl_dir, &pl_dir); return strlcpy(dirbuf, pl_dir, dirbuf_sz); } -- cgit v1.2.3