aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/ftp.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-10-12 20:52:54 +1300
committerTom Ryder <tom@sanctum.geek.nz>2013-10-12 20:52:54 +1300
commitb43f3f7aafbede00ba9c63697a2db659f1d60e9c (patch)
tree3448303e47b161350746184ff83ff9be75b550bc /bash/bashrc.d/ftp.bash
parentInline unneeded variable in completion function (diff)
downloaddotfiles-b43f3f7aafbede00ba9c63697a2db659f1d60e9c.tar.gz
dotfiles-b43f3f7aafbede00ba9c63697a2db659f1d60e9c.zip
Adjust declarations of local vars in compspecs
Diffstat (limited to 'bash/bashrc.d/ftp.bash')
-rw-r--r--bash/bashrc.d/ftp.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/ftp.bash b/bash/bashrc.d/ftp.bash
index 8952cbb8..e46cc474 100644
--- a/bash/bashrc.d/ftp.bash
+++ b/bash/bashrc.d/ftp.bash
@@ -1,10 +1,9 @@
# Completion for ftp with .netrc machines
_ftp() {
- local netrc=$HOME/.netrc
local word=${COMP_WORDS[COMP_CWORD]}
- local -a machines
# Bail if the .netrc file is illegible
+ local netrc=$HOME/.netrc
if [[ ! -r $netrc ]]; then
return 1
fi
@@ -14,7 +13,8 @@ _ftp() {
IFS=$' \t\n' read -a tokens -d '' -r < "$netrc"
# Iterate through tokens and collect machine names
- local machine=0
+ local -a machines
+ local token machine
for token in "${tokens[@]}"; do
if ((machine)); then
machines=("${machines[@]}" "$token")