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.
This commit is contained in:
@@ -556,10 +556,10 @@ suffix() {
|
|||||||
local -a names
|
local -a names
|
||||||
# Take everything before "--" and quote special characters
|
# Take everything before "--" and quote special characters
|
||||||
names=( "${(@q)@:1:$((i-1))}" )
|
names=( "${(@q)@:1:$((i-1))}" )
|
||||||
# Prepend an `*` to every element and quote the result
|
# Prepend an `*` to every element
|
||||||
names=( "${(@)names//(#b)(*)/\"*$match\"}")
|
names=( "${(@)names//#/*}" )
|
||||||
# Join with " -o -name " and then split again using shell parsing
|
# Join with " -o -name " and then split again using shell parsing
|
||||||
names=( "${(@zj: -o -name :)names}" )
|
names=( "${(@zj: -o -name :)names}" )
|
||||||
# Pass starting points and the names after removing one level of quotes
|
# Pass starting points and the name arguments
|
||||||
find "${@:$((i+1))}" -name "${(@Q)names}"
|
find "${@:$((i+1))}" -name "${(@)names}"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user