1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 02:43:54 +02:00

getNameFromURL(): Support uppercase characters in attribute names

In particular, this makes it handle 'legacyPackages' correctly.
This commit is contained in:
Eelco Dolstra 2023-12-22 16:35:58 +01:00
parent d65d56fa77
commit 936a364226
2 changed files with 6 additions and 4 deletions

View file

@ -4,7 +4,7 @@
namespace nix {
static const std::string attributeNamePattern("[a-z0-9_-]+");
static const std::string attributeNamePattern("[a-zA-Z0-9_-]+");
static const std::regex lastAttributeRegex("(?:" + attributeNamePattern + "\\.)*(?!default)(" + attributeNamePattern +")(\\^.*)?");
static const std::string pathSegmentPattern("[a-zA-Z0-9_-]+");
static const std::regex lastPathSegmentRegex(".*/(" + pathSegmentPattern +")");