lib/strings: convert to string within hasInfix

This should fix the issue mentioned here:
https://github.com/NixOS/nixpkgs/pull/168175#issuecomment-1107830574
This commit is contained in:
Daniel Thwaites 2022-04-24 14:17:43 +01:00
parent 6d21b873f3
commit e888c2133f
No known key found for this signature in database
GPG Key ID: D8AFC4BF05670F9D

View File

@ -254,7 +254,7 @@ rec {
=> false
*/
hasInfix = infix: content:
builtins.match ".*${escapeRegex infix}.*" content != null;
builtins.match ".*${escapeRegex infix}.*" "${content}" != null;
/* Convert a string to a list of characters (i.e. singleton strings).
This allows you to, e.g., map a function over each character. However,