patch from normalperson

git-svn-id: https://svn.musicpd.org/mpd/trunk@1679 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-06-26 17:33:42 +00:00
parent 188011ac52
commit 366e370cb0

View File

@ -168,11 +168,14 @@ int lsPlaylists(FILE * fp, char * utf8path) {
free(path);
if(list) {
int i;
sortList(list);
dup = malloc(strlen(utf8path)+2);
strcpy(dup,utf8path);
while(dup[strlen(dup)-1]=='/') dup[strlen(dup)-1] = '\0';
for(i = strlen(dup)-1; i >= 0 && dup[i]=='/'; i--) {
dup[i] = '\0';
}
if(strlen(dup)) strcat(dup,"/");
node = list->firstNode;