Skip to content

Commit a53cd5e

Browse files
kevincoxOliver Kiddle
authored andcommitted
github #147: Clean up some leaked variables in completion functions
1 parent 48e612f commit a53cd5e

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
2025-10-23 Oliver Kiddle <[email protected]>
22

3+
* Kevin Cox: github #147: Completion/Unix/Command/_git,
4+
Completion/Unix/Command/_ssh, Completion/Unix/Type/_hosts:
5+
Clean up some leaked variables in completion functions
6+
37
* 53999: Src/module.c: remove further remnants of ansi2knr
48
support from AIX specific code
59

Completion/Unix/Command/_git

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7181,7 +7181,7 @@ __git_remote_branch_names () {
71817181
__git_remote_branch_names_noprefix () {
71827182
declare -a heads
71837183

7184-
branch_names=(${${${${(f)"$(_call_program remote-branch-refs-noprefix git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/}#*/}:#HEAD})
7184+
local branch_names=(${${${${(f)"$(_call_program remote-branch-refs-noprefix git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/}#*/}:#HEAD})
71857185
__git_command_successful $pipestatus || return 1
71867186

71877187
__git_describe_commit branch_names remote-branch-names-noprefix 'remote branch name' "$@"

Completion/Unix/Command/_ssh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# TODO: sshd, ssh-keysign
44

55
_ssh () {
6-
local curcontext="$curcontext" state line expl suf arg ret=1
6+
local curcontext="$curcontext" state line lstate expl suf arg ret=1
77
local args sigargs common common_transfer options algopt tmp p1 file cmn cmds sdesc tdesc
88
typeset -A opt_args tsizes
99

Completion/Unix/Type/_hosts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if ! zstyle -a ":completion:${curcontext}:hosts" hosts _hosts; then
4141

4242
for khostfile in $khostfiles; do
4343
if [[ -r $khostfile ]]; then
44-
khosts=(${(s/,/j/,/u)${(f)"$(<$khostfile)"}%%[ |#]*})
44+
local khosts=(${(s/,/j/,/u)${(f)"$(<$khostfile)"}%%[ |#]*})
4545

4646
# known_hosts syntax supports the host being in the form [hostname]:port
4747
# The filter below extracts the hostname from lines using this format.

0 commit comments

Comments
 (0)