mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
Merge pull request #277 from chme/scandirectories
[filescanner] Fix building directory structure with trailing '/'
This commit is contained in:
commit
2e4b5a70a5
@ -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
Block a user