mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-03 10:21:46 +02:00
53095: fix completion for chmod/chown --reference with escaped filename
This commit is contained in:
parent
62131ae049
commit
91c56ed27a
3 changed files with 9 additions and 5 deletions
|
@ -1,5 +1,9 @@
|
|||
2024-09-18 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* Philip Sequeira: 53095: Completion/Unix/Command/_chmod,
|
||||
Completion/Unix/Command/_chown: fix completion for chmod/chown
|
||||
--reference with escaped filename
|
||||
|
||||
* 53094: configure.ac, Src/signals.h: remove unused autoconf tests
|
||||
|
||||
* 53093: Src/input.c: silence compiler warning when USE_LSEEK
|
||||
|
|
|
@ -67,13 +67,13 @@ case "$variant" in
|
|||
;;
|
||||
esac
|
||||
|
||||
_arguments -C -s -S $aopts "$args[@]" && ret=0
|
||||
_arguments -C -s -S -0 $aopts "$args[@]" && ret=0
|
||||
|
||||
case "$state" in
|
||||
files)
|
||||
if [[ -n $opt_args[--reference] ]]; then
|
||||
zmodload -F zsh/stat b:zstat 2>/dev/null
|
||||
typeset -i8 ref=$(zstat +mode $opt_args[--reference])
|
||||
typeset -i8 ref=$(zstat +mode $opt_args[--reference]:Q)
|
||||
_wanted files expl file _files -g "*(-.^f${ref#??})" && ret=0
|
||||
elif [[ $line[1] = [0-7]## ]]; then
|
||||
_wanted files expl file _files -g "*(-.^f$line[1])" && ret=0
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue