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
This commit is contained in:
@@ -193,7 +193,7 @@ rec {
|
|||||||
normalizePath "/a//b///c/"
|
normalizePath "/a//b///c/"
|
||||||
=> "/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
|
/* Depending on the boolean `cond', return either the given string
|
||||||
or the empty string. Useful to concatenate against a bigger string.
|
or the empty string. Useful to concatenate against a bigger string.
|
||||||
|
|||||||
Reference in New Issue
Block a user