From 7d3328e4cc036ba803b60b03ac18f07cdb1afbbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophane=20Hufschmitt?= Date: Tue, 27 Feb 2024 06:58:42 +0100 Subject: [PATCH] find-roots: Fix regex to match store paths Has been made a bit more lenient upstream, so match that --- src/nix-find-roots/lib/find-roots.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nix-find-roots/lib/find-roots.cc b/src/nix-find-roots/lib/find-roots.cc index 788f00465..84240b7b8 100644 --- a/src/nix-find-roots/lib/find-roots.cc +++ b/src/nix-find-roots/lib/find-roots.cc @@ -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)