Skip to content

Commit 40aa4dc

Browse files
committed
Merge branch 'fix/load-completion-dot'
2 parents 3368d9b + 16ce83f commit 40aa4dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bash_completion

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,9 +2558,12 @@ __load_completion()
25582558
[[ -d $dir ]] || continue
25592559
for compfile in "$cmd" "$cmd.bash" "_$cmd"; do
25602560
compfile="$dir/$compfile"
2561-
# Avoid trying to source dirs; https://bugzilla.redhat.com/903540
2561+
# Avoid trying to source dirs as long as we support bash < 4.3
2562+
# to avoid an fd leak; https://bugzilla.redhat.com/903540
25622563
if [[ -d $compfile ]]; then
2563-
echo "bash_completion: $compfile: is a directory" >&2
2564+
# Do not warn with . or .. (especially the former is common)
2565+
[[ $compfile == */.?(.) ]] ||
2566+
echo "bash_completion: $compfile: is a directory" >&2
25642567
elif [[ -e $compfile ]] && . "$compfile"; then
25652568
[[ $backslash ]] && $(complete -p "$cmd") "\\$cmd"
25662569
return 0

0 commit comments

Comments
 (0)