db/update/Archive: move check to IsAcceptableFilename()
This commit is contained in:
parent
dcc7628b67
commit
395bf34a91
@ -35,6 +35,13 @@ LockFindSong(Directory &directory, std::string_view name) noexcept
|
|||||||
return directory.FindSong(name);
|
return directory.FindSong(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[gnu::pure]]
|
||||||
|
static bool
|
||||||
|
IsAcceptableFilename(std::string_view name) noexcept
|
||||||
|
{
|
||||||
|
return !name.empty();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
UpdateWalk::UpdateArchiveTree(ArchiveFile &archive, Directory &directory,
|
UpdateWalk::UpdateArchiveTree(ArchiveFile &archive, Directory &directory,
|
||||||
std::string_view name) noexcept
|
std::string_view name) noexcept
|
||||||
@ -48,7 +55,7 @@ UpdateWalk::UpdateArchiveTree(ArchiveFile &archive, Directory &directory,
|
|||||||
//create directories first
|
//create directories first
|
||||||
UpdateArchiveTree(archive, *subdir, rest);
|
UpdateArchiveTree(archive, *subdir, rest);
|
||||||
} else {
|
} else {
|
||||||
if (name.empty())
|
if (!IsAcceptableFilename(name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//add file
|
//add file
|
||||||
|
Loading…
Reference in New Issue
Block a user