absolute-pathname: check stringLength > 0

This commit is contained in:
tv 2016-07-03 19:41:31 +02:00
parent 9962ba1036
commit 57098e472a

View File

@ -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;
};