diff --git a/.config/zsh/zshrc.d/40-functions.zsh b/.config/zsh/zshrc.d/40-functions.zsh index 6c34a8d..8b15e96 100644 --- a/.config/zsh/zshrc.d/40-functions.zsh +++ b/.config/zsh/zshrc.d/40-functions.zsh @@ -554,8 +554,8 @@ suffix() { # starting point is passed to `find`, which then defaults to `.`. local -a names - # Take everything before "--" - names=( "${@:1:$((i-1))}" ) + # Take everything before "--" and quote special characters + names=( "${(@q)@:1:$((i-1))}" ) # Prepend an `*` to every element and quote the result names=( "${(@)names//(#b)(*)/\"*$match\"}") # Join with " -o -name " and then split again using shell parsing