Merge pull request #243251 from schnusch/cgit-regex

nixos/cgit: fix \v and \f in regexEscape
This commit is contained in:
Lassulus 2023-07-14 22:03:44 +02:00 committed by GitHub
commit a4ffd00fb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,9 @@ let
# taken from https://github.com/python/cpython/blob/05cb728d68a278d11466f9a6c8258d914135c96c/Lib/re.py#L251-L266
special = [
"(" ")" "[" "]" "{" "}" "?" "*" "+" "-" "|" "^" "$" "\\" "." "&" "~"
"#" " " "\t" "\n" "\r" "\v" "\f"
"#" " " "\t" "\n" "\r"
" " # \v / 0x0B
" " # \f / 0x0C
];
in
replaceStrings special (map (c: "\\${c}") special);