diff options
-rw-r--r-- | bash/bash_completion.d/man.bash | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bash/bash_completion.d/man.bash b/bash/bash_completion.d/man.bash index d2499c0a..7456f69b 100644 --- a/bash/bash_completion.d/man.bash +++ b/bash/bash_completion.d/man.bash @@ -27,13 +27,12 @@ _man() { shopt -u dotglob shopt -s extglob nullglob - # Start an array of pages - declare -a pages - # Break manpath(1) output into an array of paths + declare -a manpaths IFS=: read -a manpaths -r < <(manpath 2>/dev/null) # Iterate through the manual page paths and add every manual page we find + declare -a pages for manpath in "${manpaths[@]}" ; do [[ -n $manpath ]] || continue if [[ -n $section ]] ; then |