diff options
author | Guillaume Girol <symphorien+git@xlumurb.eu> | 2022-10-23 12:00:00 +0000 |
---|---|---|
committer | zowoq <59103226+zowoq@users.noreply.github.com> | 2022-10-24 12:25:34 +1000 |
commit | 956e35d0b10cd48df91e1b4e2c928efe178335ed (patch) | |
tree | 1d8a467fdf7e4781eff6c88f0be6a4ed860816cf /lib | |
parent | 90eb7cc0aaf1b1c0ce40da6e0d6c4912a5aa7382 (diff) |
lib.normalizePath: the empty string is not a valid regex on darwin
presumably due to using libc++'s regex lib instead of libstdc++ on linux Fixes https://github.com/NixOS/nixpkgs/pull/177273#issuecomment-1287562800
Diffstat (limited to 'lib')
-rw-r--r-- | lib/strings.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/strings.nix b/lib/strings.nix index be217cb064697..af26532aa4305 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -193,7 +193,7 @@ rec { normalizePath "/a//b///c/" => "/a/b/c/" */ - normalizePath = s: (builtins.foldl' (x: y: if y == "/" && hasSuffix "/" x then x else x+y) "" (splitString "" s)); + normalizePath = s: (builtins.foldl' (x: y: if y == "/" && hasSuffix "/" x then x else x+y) "" (stringToCharacters s)); /* Depending on the boolean `cond', return either the given string or the empty string. Useful to concatenate against a bigger string. |