# HG changeset patch # User mf0102 <0102@gmx.at> # Date 1205786284 -3600 # Node ID 50ae65a59351df6cc269278b5408c2b55142e968 # Parent 2c8bb51ba9cdd79d0dd5ed5a9f9e70bc9f54ba72 patch by chrome diff -r 2c8bb51ba9cd -r 50ae65a59351 src/xspf/xspf.c --- a/src/xspf/xspf.c Fri Mar 14 15:13:40 2008 +0200 +++ b/src/xspf/xspf.c Mon Mar 17 21:38:04 2008 +0100 @@ -367,7 +367,7 @@ if (playlist->attribute & PLAYLIST_USE_RELATIVE) { /* prescan to determine base uri */ for (node = playlist->entries; node != NULL; node = g_list_next(node)) { - gchar *ptr1, *ptr2; + gchar *ptr1, *ptr2, *ptrslash; PlaylistEntry *entry = PLAYLIST_ENTRY(node->data); gchar *tmp; gint tmplen = 0; @@ -385,15 +385,18 @@ } ptr1 = base; - ptr2 = tmp; + ptrslash = ptr2 = tmp; while(ptr1 && ptr2 && *ptr1 && *ptr2 && *ptr1 == *ptr2) { + if (*ptr2 == '/') ptrslash = ptr2 + 1; + ptr1++; ptr2++; } - *ptr2 = '\0'; //terminate - tmplen = ptr2 - tmp; + if (!(*ptrslash)) ptrslash--; + *ptrslash = '\0'; //terminate + tmplen = ptrslash - tmp; if (tmplen <= baselen) { g_free(base);