diff options
| author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-04-05 20:31:50 +0200 |
|---|---|---|
| committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-06-15 22:29:46 +0200 |
| commit | 592213ad3f4de2cf3a0f13ab8271122e5e9f9822 (patch) | |
| tree | 37b96530c9c7ca6eb3e862511043d1b9455a2b76 /lib/strings.nix | |
| parent | lib.path.append: Add a law (diff) | |
| download | nixpkgs-592213ad3f4de2cf3a0f13ab8271122e5e9f9822.tar.gz | |
lib.path.hasPrefix: init
Diffstat (limited to 'lib/strings.nix')
| -rw-r--r-- | lib/strings.nix | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/strings.nix b/lib/strings.nix index e875520c6858..bb07f40d7a55 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -264,7 +264,8 @@ rec { lib.strings.hasPrefix: The first argument (${toString pref}) is a path value, but only strings are supported. There is almost certainly a bug in the calling code, since this function always returns `false` in such a case. This function also copies the path to the Nix store, which may not be what you want. - This behavior is deprecated and will throw an error in the future.'' + This behavior is deprecated and will throw an error in the future. + You might want to use `lib.path.hasPrefix` instead, which correctly supports paths.'' (substring 0 (stringLength pref) str == pref); /* Determine whether a string has given suffix. |
