Commit 16a99804 authored by Max Kellermann's avatar Max Kellermann

db/update/Archive: move check to IsAcceptableFilename()

parent 75a39ed2
......@@ -51,6 +51,13 @@ LockFindSong(Directory &directory, std::string_view name) noexcept
return directory.FindSong(name);
}
[[gnu::pure]]
static bool
IsAcceptableFilename(std::string_view name) noexcept
{
return !name.empty();
}
void
UpdateWalk::UpdateArchiveTree(ArchiveFile &archive, Directory &directory,
const char *name) noexcept
......@@ -65,7 +72,7 @@ UpdateWalk::UpdateArchiveTree(ArchiveFile &archive, Directory &directory,
//create directories first
UpdateArchiveTree(archive, *subdir, tmp + 1);
} else {
if (StringIsEmpty(name))
if (!IsAcceptableFilename(name))
return;
//add file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment