From be6e5df3eaf98740c867c14856304322f3d05648 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Fri, 3 Jun 2022 21:49:05 +0200 Subject: [PATCH] zsh:funcs:suffix: Do not quote extra Since 5258b5ed4217 ("zsh:funcs:suffix: Support quotes), all special are escaped anyway (including whitespace), making it unnecessary to quote the names extra. --- .config/zsh/zshrc.d/40-functions.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/zsh/zshrc.d/40-functions.zsh b/.config/zsh/zshrc.d/40-functions.zsh index 8b15e96..64c63bb 100644 --- a/.config/zsh/zshrc.d/40-functions.zsh +++ b/.config/zsh/zshrc.d/40-functions.zsh @@ -556,10 +556,10 @@ suffix() { local -a names # 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\"}") + # Prepend an `*` to every element + names=( "${(@)names//#/*}" ) # Join with " -o -name " and then split again using shell parsing names=( "${(@zj: -o -name :)names}" ) - # Pass starting points and the names after removing one level of quotes - find "${@:$((i+1))}" -name "${(@Q)names}" + # Pass starting points and the name arguments + find "${@:$((i+1))}" -name "${(@)names}" }