Merge branch 'struc' of git://github.com/neheb/MPD

This commit is contained in:
Max Kellermann
2021-03-04 17:50:53 +01:00
15 changed files with 49 additions and 61 deletions

View File

@@ -427,21 +427,19 @@ UpdateWalk::DirectoryMakeUriParentChecked(Directory &root,
StringView uri(_uri);
while (true) {
auto s = uri.Split('/');
const std::string_view name = s.first;
const auto rest = s.second;
auto [name, rest] = uri.Split('/');
if (rest == nullptr)
break;
if (!name.empty()) {
directory = DirectoryMakeChildChecked(*directory,
std::string(name).c_str(),
s.first);
name);
if (directory == nullptr)
break;
}
uri = s.second;
uri = rest;
}
return directory;