diff options
author | William Wilgus <wilgus.william@gmail.com> | 2024-03-29 16:09:56 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2024-03-30 11:01:53 -0400 |
commit | fe00906abb355a40888e7a2ce785ddfe3cfc525f (patch) | |
tree | 78ebfcc04d1a540636d3574eb3f27925fa88a4bd /apps | |
parent | 777098fca9765900202d8d9c1698c57f136c7338 (diff) | |
download | rockbox-fe00906abb355a40888e7a2ce785ddfe3cfc525f.tar.gz rockbox-fe00906abb355a40888e7a2ce785ddfe3cfc525f.zip |
pathfuncs.c add path_strip_leading_separators()
added to path_append as well
Change-Id: Ieb6ec4f4c475ca5e60c8246c7f044bcc7651f6bf
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playlist_catalog.c | 7 |
1 files changed, 2 insertions, 5 deletions
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; | |||
70 | 70 | ||
71 | static size_t get_directory(char* dirbuf, size_t dirbuf_sz) | 71 | static size_t get_directory(char* dirbuf, size_t dirbuf_sz) |
72 | { | 72 | { |
73 | char *pl_dir = PLAYLIST_CATALOG_DEFAULT_DIR; | 73 | const char *pl_dir = PLAYLIST_CATALOG_DEFAULT_DIR; |
74 | 74 | ||
75 | /* directory config is of the format: "dir: /path/to/dir" */ | 75 | /* directory config is of the format: "dir: /path/to/dir" */ |
76 | if (global_settings.playlist_catalog_dir[0] != '\0') | 76 | if (global_settings.playlist_catalog_dir[0] != '\0') |
@@ -79,10 +79,7 @@ static size_t get_directory(char* dirbuf, size_t dirbuf_sz) | |||
79 | } | 79 | } |
80 | 80 | ||
81 | /* remove duplicate leading '/' */ | 81 | /* remove duplicate leading '/' */ |
82 | if (pl_dir[0] == '/' && pl_dir[1] == '/') | 82 | path_strip_leading_separators(pl_dir, &pl_dir); |
83 | { | ||
84 | pl_dir++; | ||
85 | } | ||
86 | 83 | ||
87 | return strlcpy(dirbuf, pl_dir, dirbuf_sz); | 84 | return strlcpy(dirbuf, pl_dir, dirbuf_sz); |
88 | } | 85 | } |