From 36de745e1b705644d22b0d7f8fc60fdedb49d2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 19 Mar 2017 10:16:44 +0100 Subject: [PATCH] readPathsFromFile: fixup after #23851 The final newline would produce an empty string; let's filter all empty lines as well. --- lib/strings.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/strings.nix b/lib/strings.nix index eb3c2971ad59..44b6f8780c84 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