summaryrefslogtreecommitdiffstats
path: root/krebs/4lib/types.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-07-03 19:41:31 +0200
committertv <tv@krebsco.de>2016-07-03 19:41:31 +0200
commit57098e472a1677883b7f95d0d0b5c815ca1b2b3b (patch)
treed0972a879b5ff68f63e0373782c6413d1695edc1 /krebs/4lib/types.nix
parent9962ba1036945652c1b1cfd661d92377b4dc691e (diff)
absolute-pathname: check stringLength > 0
Diffstat (limited to 'krebs/4lib/types.nix')
-rw-r--r--krebs/4lib/types.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix
index 0d5b51f76..be0acd584 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;
};