From d523ddaba2cd160343b54d3e38ea001c63a87dc6 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 16 Sep 2016 04:02:08 +0000 Subject: unposted: _postfix: Correct quoting in _call_program invocations. Fixes completion when the command name ('postconf') or the argument to the -c option ('/etc/postfix') are quoted on the command line, as in % postconf -c '/etc/postfix' ... --- Completion/Unix/Command/_postfix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command/_postfix') diff --git a/Completion/Unix/Command/_postfix b/Completion/Unix/Command/_postfix index 26a262bd3..006c950e3 100644 --- a/Completion/Unix/Command/_postfix +++ b/Completion/Unix/Command/_postfix @@ -30,11 +30,11 @@ _postfix_main_cf_parameter() { # # don't bother to add -c in this case: the defaults don't depend on the config dir. _wanted parameters expl 'main.cf parameter' compadd "$@" -- \ - ${${(f)"$(_call_program postconf_-d "${(q)words[1]} -$kind")"}%% =*} + ${${(f)"$(_call_program postconf_-d "${words[1]} -$kind")"}%% =*} ;; (n) # Show the values too. - local -a kv=( ${${(f)"$(_call_program postconf_-n "${(q)words[1]} ${opt_args[-c]+"-c ${(q)opt_args[-c]}"} -$kind")"}/ = /:} ) + local -a kv=( ${${(f)"$(_call_program postconf_-n "${words[1]} ${opt_args[-c]+"-c ${opt_args[-c]}"} -$kind")"}/ = /:} ) _describe -t parameters 'main.cf parameter' kv ;; (*) @@ -50,7 +50,7 @@ _postfix_main_cf_parameter_and_value() { # completing «postconf foo=bar=» would change main.cf. So, don't remove # it. if compset -P 1 '*='; then - local value="`_call_program postconf-get-value-at-dir "${(q)words[1]} ${opt_args[-c]+"-c ${(q)opt_args[-c]}"} -h -- ${(q)IPREFIX%=}"`" + local value="`_call_program postconf-get-value-at-dir "${words[1]} ${opt_args[-c]+"-c ${opt_args[-c]}"} -h -- ${(q)IPREFIX%=}"`" [[ -n $value ]] && compadd "$@" -- $value else _postfix_main_cf_parameter d -S= -- cgit 1.4.1