Skip to content

Commit

Permalink
fix(_included_ssh_config_files): fix for failglob
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Feb 25, 2022
1 parent 59ec460 commit 36a540f
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ _included_ssh_config_files()
{
(($# < 1)) &&
echo "bash_completion: $FUNCNAME: missing mandatory argument CONFIG" >&2
local configfile i f
local configfile i files f
configfile=$1

local IFS=$' \t\n' reset=$(shopt -po noglob)
Expand All @@ -1789,15 +1789,16 @@ _included_ssh_config_files()
fi
__expand_tilde_by_ref i
# In case the expanded variable contains multiple paths
set +o noglob
for f in $i; do
if [[ -r $f ]]; then
config+=("$f")
# The Included file is processed to look for Included files in itself
_included_ssh_config_files $f
fi
done
$reset
_comp_expand_glob files '$i'
if ((${#files[@]})); then
for f in "${files[@]}"; do
if [[ -r $f ]]; then
config+=("$f")
# The Included file is processed to look for Included files in itself
_included_ssh_config_files $f
fi
done
fi
done
} # _included_ssh_config_files()

Expand Down

0 comments on commit 36a540f

Please sign in to comment.