Merge pull request #277 from chme/scandirectories

[filescanner] Fix building directory structure with trailing '/'
This commit is contained in:
ejurgensen 2016-07-31 07:56:15 +02:00 committed by GitHub
commit 2e4b5a70a5
1 changed files with 6 additions and 0 deletions

View File

@ -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';