[filescanner] Fix building directory structure with trailing '/'
Library directories with a trailing '/' (like '/srv/music/') lead to an unbrowsable directory structure. The trailing '/' resulted in an update to the library directory in the directories table with a parent_id pointing to itself.
This commit is contained in:
parent
3dbf6d2416
commit
cebf07b2f8
|
@ -1092,6 +1092,12 @@ process_parent_directories(char *path)
|
|||
ptr = path + 1;
|
||||
while (ptr && (ptr = strchr(ptr, '/')))
|
||||
{
|
||||
if ((ptr - path) > 0)
|
||||
{
|
||||
// Do not process trailing '/'
|
||||
break;
|
||||
}
|
||||
|
||||
strncpy(buf, path, (ptr - path));
|
||||
buf[(ptr - path)] = '\0';
|
||||
|
||||
|
|
Loading…
Reference in New Issue