summary refs log tree commit diff
path: root/lib/strings.nix
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2017-03-19 10:16:44 +0100
committerVladimír Čunát <vcunat@gmail.com>2017-03-19 10:19:20 +0100
commit36de745e1b705644d22b0d7f8fc60fdedb49d2d3 (patch)
treed443a07d611ae84283c24f3f4fa358b207a0cf00 /lib/strings.nix
parent48deda9f367b24a9ca122f13a9f6659ed2bfe75d (diff)
downloadnixpkgs-36de745e1b705644d22b0d7f8fc60fdedb49d2d3.tar
nixpkgs-36de745e1b705644d22b0d7f8fc60fdedb49d2d3.tar.gz
nixpkgs-36de745e1b705644d22b0d7f8fc60fdedb49d2d3.tar.bz2
nixpkgs-36de745e1b705644d22b0d7f8fc60fdedb49d2d3.tar.lz
nixpkgs-36de745e1b705644d22b0d7f8fc60fdedb49d2d3.tar.xz
nixpkgs-36de745e1b705644d22b0d7f8fc60fdedb49d2d3.tar.zst
nixpkgs-36de745e1b705644d22b0d7f8fc60fdedb49d2d3.zip
readPathsFromFile: fixup after #23851
The final newline would produce an empty string;
let's filter all empty lines as well.
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 eb3c2971ad5..44b6f8780c8 100644
--- a/lib/strings.nix
+++ b/lib/strings.nix
@@ -479,7 +479,7 @@ rec {
       lines =
         builtins.map (lib.removeSuffix "\n")
         (lib.splitString "\n" (builtins.readFile file));
-      removeComments = lib.filter (line: !(lib.hasPrefix "#" line));
+      removeComments = lib.filter (line: line != "" && !(lib.hasPrefix "#" line));
       relativePaths = removeComments lines;
       absolutePaths = builtins.map (path: builtins.toPath (root + "/" + path)) relativePaths;
     in