zsh:funcs:suffix: Support quotes
Quotes need to be escaped, otherwise `(Q)` will not work on potential uneven number of quotes.
This commit is contained in:
@@ -554,8 +554,8 @@ suffix() {
|
|||||||
# starting point is passed to `find`, which then defaults to `.`.
|
# starting point is passed to `find`, which then defaults to `.`.
|
||||||
|
|
||||||
local -a names
|
local -a names
|
||||||
# Take everything before "--"
|
# Take everything before "--" and quote special characters
|
||||||
names=( "${@:1:$((i-1))}" )
|
names=( "${(@q)@:1:$((i-1))}" )
|
||||||
# Prepend an `*` to every element and quote the result
|
# Prepend an `*` to every element and quote the result
|
||||||
names=( "${(@)names//(#b)(*)/\"*$match\"}")
|
names=( "${(@)names//(#b)(*)/\"*$match\"}")
|
||||||
# Join with " -o -name " and then split again using shell parsing
|
# Join with " -o -name " and then split again using shell parsing
|
||||||
|
|||||||
Reference in New Issue
Block a user