Sanity check command names (fixes #2227)

This commit is contained in:
Vidar Holen 2021-06-05 18:16:22 -07:00
parent 331e89be99
commit 163b2f12e2
3 changed files with 44 additions and 0 deletions

View file

@ -877,6 +877,10 @@ getBracedModifier s = headOrDefault "" $ do
headOrDefault _ (a:_) = a
headOrDefault def _ = def
-- Get the last element or a default. Like `last` but safe.
lastOrDefault def [] = def
lastOrDefault _ list = last list
--- Get element n of a list, or Nothing. Like `!!` but safe.
(!!!) list i =
case drop i list of