find-roots: Fix regex to match store paths

Has been made a bit more lenient upstream, so match that
This commit is contained in:
Théophane Hufschmitt
2024-02-27 06:58:42 +01:00
parent 79a2997b9e
commit 7d3328e4cc

View File

@@ -29,7 +29,7 @@ static std::string quoteRegexChars(const std::string & raw)
}
static std::regex storePathRegex(const fs::path storeDir)
{
return std::regex(quoteRegexChars(storeDir) + R"(/[0-9a-z]+[0-9a-zA-Z\+\-\._\?=]*)");
return std::regex(quoteRegexChars(storeDir) + R"((?!\.\.?(-|$))[0-9a-zA-Z\+\-\._\?=]+)");
}
static bool isInStore(fs::path storeDir, fs::path dir)