Skip to content

Commit a31906c

Browse files
committed
fix(openssl): avoid variable conflicts
1 parent 0d145c9 commit a31906c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

completions/openssl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22

33
_comp_cmd_openssl__compgen_sections()
44
{
5-
local config i f
5+
local config _i _file
66

77
# check if a specific configuration file is used
8-
for ((i = 2; i < cword; i++)); do
9-
if [[ ${words[i]} == -config ]]; then
10-
config=${words[i + 1]}
8+
for ((_i = 2; _i < cword; _i++)); do
9+
if [[ ${words[_i]} == -config ]]; then
10+
config=${words[_i + 1]}
1111
break
1212
fi
1313
done
1414

1515
# if no config given, check some usual default locations
1616
if [[ ! $config ]]; then
17-
for f in /etc/ssl/openssl.cnf /etc/pki/tls/openssl.cnf \
17+
for _file in /etc/ssl/openssl.cnf /etc/pki/tls/openssl.cnf \
1818
/usr/share/ssl/openssl.cnf; do
19-
[[ -f $f ]] && config=$f && break
19+
[[ -f $_file ]] && config=$_file && break
2020
done
2121
fi
2222

2323
[[ ! -f $config ]] && return
2424

25-
_comp_compgen_split -- "$(awk '/\[.*\]/ {print $2}' "$config")"
25+
_comp_compgen -U config split -- "$(awk '/\[.*\]/ {print $2}' "$config")"
2626
}
2727

2828
_comp_cmd_openssl__compgen_digests()

0 commit comments

Comments
 (0)