summaryrefslogtreecommitdiff
path: root/shells/zsh/patches/patch-Completion_Unix_Command___gpg
blob: 1125dd1bbe63ef8d128cd15a2e4104031fb92bf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$NetBSD: patch-Completion_Unix_Command___gpg,v 1.2 2022/05/16 14:58:30 ryoon Exp $

Fix an issue in _gpg. Simply typing "gpg2 [TAB]" fails with an error:

  _gpg:176: \[]*} not found

[pho@] I couldn't figure out what was really going on. These nested
parameter expansions don't look wrong, yet zsh-5.8 somehow fails to
process them. Maybe it's misinterpreted as an indexed array
assignment? Creating arrays with unquoted values is a bad idea anyway,
because they can easily cause shell expansions in a totally unexpected
way.

--- Completion/Unix/Command/_gpg.orig	2022-05-08 06:18:22.000000000 +0000
+++ Completion/Unix/Command/_gpg
@@ -173,8 +173,8 @@ fi
   '--dump-options[show all options]'
 )
 
-extra=( ${${${args#\([^\)]#\)}#\*}%%[=:\[]*} )
-extra=( ${allopts:|extra} )
+extra=( "${(@)${(@)${(@)args#\([^\)]#\)}#\*}%%[:=\[]*}" )
+extra=( "${(@)allopts:|extra}" )
 _arguments -C -s -S -A "-*" $args $extra '*:args:->args' && ret=0
 
 if [[ $state = args ]]; then