aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-26 17:33:42 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-26 17:33:42 +0000
commit366e370cb0d5f623b5b46c8419c895408b2fb756 (patch)
treeb4c392177f325a57068a78903b4c232d411a81ff /src
parent188011ac52932eb2c75dc1e956417ddcf33512bf (diff)
downloadmpd-366e370cb0d5f623b5b46c8419c895408b2fb756.tar.gz
mpd-366e370cb0d5f623b5b46c8419c895408b2fb756.tar.xz
mpd-366e370cb0d5f623b5b46c8419c895408b2fb756.zip
patch from normalperson
git-svn-id: https://svn.musicpd.org/mpd/trunk@1679 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/ls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ls.c b/src/ls.c
index 97df3c061..c0ff6e87c 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -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;