summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_chown
diff options
context:
space:
mode:
authorPhilip Sequeira <qmega@sksm.net>2024-09-16 04:13:38 -0400
committerOliver Kiddle <opk@zsh.org>2024-09-18 11:08:08 +0200
commit91c56ed27a7e191a257778af831e3d491cdb995c (patch)
tree4886dfcc6beae3a58e5654ae153c9caf95f929f6 /Completion/Unix/Command/_chown
parent62131ae0499da56ecad237e5f82007a73cfff4fd (diff)
downloadzsh-91c56ed27a7e191a257778af831e3d491cdb995c.tar.gz
zsh-91c56ed27a7e191a257778af831e3d491cdb995c.zip
53095: fix completion for chmod/chown --reference with escaped filename
Diffstat (limited to 'Completion/Unix/Command/_chown')
-rw-r--r--Completion/Unix/Command/_chown6
1 files changed, 3 insertions, 3 deletions
diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown
index 4362d6e75..bcc6aec2f 100644
--- a/Completion/Unix/Command/_chown
+++ b/Completion/Unix/Command/_chown
@@ -71,7 +71,7 @@ case "$variant" in
esac
(( $+words[(r)--reference*] )) || args+=( '(--reference)1: :->owner' )
-_arguments -C -s -S $aopts "$args[@]" '*: :->files' && ret=0
+_arguments -C -s -S -0 $aopts "$args[@]" '*: :->files' && ret=0
case $state in
owner)
@@ -95,8 +95,8 @@ case $state in
(( $+opt_args[-h] || $+opt_args[--no-dereference] )) || deref="-"
if (( $+opt_args[--reference] )); then
zmodload -F zsh/stat b:zstat 2>/dev/null
- usr=$(zstat +uid $opt_args[--reference])
- grp=$(zstat +gid $opt_args[--reference])
+ usr=$(zstat +uid $opt_args[--reference]:Q)
+ grp=$(zstat +gid $opt_args[--reference]:Q)
_wanted files expl file _files -g "*($deref^u$usr,$deref^g$grp)" && ret=0
return ret
fi