fscache: removePrefix(): use starts_with()
此提交包含在:
2
cache/fscache.cpp
已供應
2
cache/fscache.cpp
已供應
@ -46,7 +46,7 @@ void FsCache::removePrefix(std::string_view prefix)
|
||||
// TODO: lock dir
|
||||
for(auto &entry : std::filesystem::directory_iterator(std::filesystem::path{this->path}))
|
||||
{
|
||||
if(static_cast<std::string>(entry.path().filename()).find(prefix) == 0)
|
||||
if(std::string_view(entry.path().filename().c_str()).starts_with(prefix) == 0)
|
||||
{
|
||||
std::filesystem::remove_all(entry);
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者