Skip to content

Commit

Permalink
fix(gdb): work around bash 4.4 ${v+"$@"}
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Feb 8, 2024
1 parent ca8e240 commit 41236da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion completions/gdb
Expand Up @@ -15,7 +15,6 @@ _comp_cmd_gdb()

# gdb [options] [executable-file [core-file or process-id]]
if ((cword == 1)); then
local IFS
compopt -o filenames
if _comp_looks_like_path "$cur"; then
# compgen -c works as expected if $cur contains any slashes.
Expand All @@ -28,6 +27,8 @@ _comp_cmd_gdb()
local path_array
_comp_compgen -Rv path_array split -F : -X '' -- "$PATH"
_comp_compgen_split -o plusdirs -- "$(
# Note: ${v+"$@"} does not work with empty IFS in bash < 4.4
IFS=$' \t\n'
find ${path_array[@]+"${path_array[@]}"} . -mindepth 1 \
-maxdepth 1 -not -type d -executable -printf '%f\n' \
2>/dev/null
Expand Down

0 comments on commit 41236da

Please sign in to comment.