about summary refs log tree commit diff
path: root/lib/strings.nix
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-05-04 15:07:56 +0200
committersternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-05-07 01:22:30 +0200
commitf39a5c4e50c3f0dfb108b399c2da2c963d4d1a98 (patch)
tree3a622b54cd1acbe1cdae6e8dc2abecd551f610cb /lib/strings.nix
parent326d0970e067da3577b353c20cde29fc22a77265 (diff)
lib/strings: forbid lists in isStorePath
When a list is passed to isStorePath this is most likely a mistake and
it is therefore better to just return false. There is one case where
this theoretically makes sense (if a list contains a single element for
which isStorePath elem), but since that case is also probably seldomly
intentional, it may save someone from debbuging unclear evaluation
errors.
Diffstat (limited to 'lib/strings.nix')
-rw-r--r--lib/strings.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/strings.nix b/lib/strings.nix
index dc287f8dd5cbd..49fa0196a0b26 100644
--- a/lib/strings.nix
+++ b/lib/strings.nix
@@ -667,7 +667,7 @@ rec {
        => false
   */
   isStorePath = x:
-    if isCoercibleToString x then
+    if !(isList x) && isCoercibleToString x then
       let str = toString x; in
       substring 0 1 str == "/"
       && dirOf str == storeDir