Skip to content

Commit 8c4445c

Browse files
committed
refactor(_comp_compgen_known_hosts): simplify the sed expression
1 parent 930fe3f commit 8c4445c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bash_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2542,7 +2542,7 @@ _comp__included_ssh_config_files()
25422542
# https://github.com/openssh/openssh-portable/blob/5ec5504f1d328d5bfa64280cd617c3efec4f78f3/readconf.c#L2240
25432543
local max_depth=16
25442544
while ((${#included[@]} > 0 && depth++ < max_depth)); do
2545-
_comp_split include_files "$(command sed -n -e 's/[[:blank:]]*#.*//' -e 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]*\(..*\)/\1/p' "${included[@]}")" || return
2545+
_comp_split include_files "$(command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]*\([^#]*\).*$/\1/p' "${included[@]}")" || return
25462546

25472547
included=()
25482548
for i in "${include_files[@]}"; do

0 commit comments

Comments
 (0)