Skip to content

Commit 1f57833

Browse files
committed
docs(_included_ssh_config_files): note max recursion depth origin
1 parent 4ac86e8 commit 1f57833

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bash_completion

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2130,7 +2130,10 @@ _included_ssh_config_files()
21302130
local -a include_files
21312131
included=("$configfile")
21322132

2133-
while ((${#included[@]} > 0 && depth++ < 16)); do
2133+
# Max recursion depth per openssh's READCONF_MAX_DEPTH:
2134+
# https://github.com/openssh/openssh-portable/blob/5ec5504f1d328d5bfa64280cd617c3efec4f78f3/readconf.c#L2240
2135+
local max_depth=16
2136+
while ((${#included[@]} > 0 && depth++ < max_depth)); do
21342137
_comp_split include_files "$(command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\(.*\)$/\1/p' "${included[@]}")" || return
21352138
included=()
21362139
for i in "${include_files[@]}"; do

0 commit comments

Comments
 (0)