summaryrefslogtreecommitdiffstats
path: root/krebs/4lib
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-06-11 16:11:22 +0200
committertv <tv@krebsco.de>2016-06-11 16:27:47 +0200
commitc80aee7a0b5f3bc064e7f02d9c3d10dc83f1ce73 (patch)
treeda88115928d3f270c6676963ecf7f50a0f6acb16 /krebs/4lib
parente48ecf1e1c6cbda48045d5425e1a4e7ee6e993e9 (diff)
krebs types.filename: admit <underscore>
Diffstat (limited to 'krebs/4lib')
-rw-r--r--krebs/4lib/types.nix5
1 files changed, 1 insertions, 4 deletions
diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix
index f65d5b68e..b048f48d8 100644
--- a/krebs/4lib/types.nix
+++ b/krebs/4lib/types.nix
@@ -325,10 +325,7 @@ types // rec {
# POSIX.1‐2013, 3.278 Portable Filename Character Set
filename = mkOptionType {
name = "POSIX filename";
- check = let
- filename-chars = stringToCharacters
- "-.0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
- in s: all (flip elem filename-chars) (stringToCharacters s);
+ check = x: match "[0-9A-Za-z._-]+" x != null;
merge = mergeOneOption;
};