Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with

This commit is contained in:
Rubidium
2024-01-17 06:30:44 +01:00
committed by rubidium42
parent 384b804f9c
commit 2d77cf9c80
16 changed files with 21 additions and 231 deletions

View File

@@ -608,7 +608,7 @@ bool TarScanner::AddFile(const std::string &filename, size_t, [[maybe_unused]] c
/* Process relative path.
* Note: The destination of links must not contain any directory-links. */
std::string dest = (std::filesystem::path(name).remove_filename() /= link).lexically_normal().string();
if (dest[0] == PATHSEPCHAR || StrStartsWith(dest, "..")) {
if (dest[0] == PATHSEPCHAR || dest.starts_with("..")) {
Debug(misc, 5, "Ignoring link pointing outside of data directory: {} -> {}", name, link);
break;
}