From 57098e472a1677883b7f95d0d0b5c815ca1b2b3b Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 3 Jul 2016 19:41:31 +0200 Subject: absolute-pathname: check stringLength > 0 --- krebs/4lib/types.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'krebs/4lib') diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix index 0d5b51f7..be0acd58 100644 --- a/krebs/4lib/types.nix +++ b/krebs/4lib/types.nix @@ -342,7 +342,9 @@ types // rec { absolute-pathname = mkOptionType { name = "POSIX absolute pathname"; check = x: let xs = splitString "/" x; xa = head xs; in - isString x && (xa == "/" || (xa == "" && all filename.check (tail xs))); + isString x + && stringLength x > 0 + && (xa == "/" || (xa == "" && all filename.check (tail xs))); merge = mergeOneOption; }; -- cgit v1.2.3