kiss: fix globs

This commit is contained in:
Dylan Araps 2021-07-06 22:00:43 +03:00
parent 837148bc9b
commit 0c51261486
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

12
kiss
View File

@ -1498,19 +1498,19 @@ args() {
# not be used here as they would conflict with kiss extensions.
case $action in
a|alternatives)
case $1 in */*|*\**|*\!*|*\[*|*\]*)
die "Invalid argument: '/!*[]' ($1)"
case $1 in *\**|*\!*|*\[*|*\]*|*' '*|*/*)
die "Invalid argument: '!*[] /' ($1)"
esac
;;
b|build|c|checksum|d|download|i|install|l|list|r|remove)
case ${action%%"${action#?}"}-$* in
i-*[\*\!\[\]]*)
die "Arguments contain invalid characters: '!*[]' ($*)"
i-*\!*|i-*\**|i-*\[*|i-*\]*|i-*' '*)
die "Arguments contain invalid characters: '!*[] ' ($*)"
;;
[!i]-*[\*\!\[\]/]*)
die "Arguments contain invalid characters: '!*[]/' ($*)"
[!i]-*\!*|[!i]-*\**|[!i]-*\[*|[!i]-*\]*|[!i]-*' '*|[!i]-*/*)
die "Arguments contain invalid characters: '!*[] /' ($*)"
;;
[!l]-)