From b3a25cfe429b8c87d9194c2d9042349ba71979c9 Mon Sep 17 00:00:00 2001 From: Russell Davis <551404+russelldavis@users.noreply.github.com> Date: Mon, 9 Jul 2018 00:58:25 -0700 Subject: [PATCH 313/352] man: Fix completion when failglob option is enabled (#225) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified-by: Ville Skyttä --- completions/man | 3 +++ 1 file changed, 3 insertions(+) diff --git a/completions/man b/completions/man index d5fa50f..37af081 100644 --- a/completions/man +++ b/completions/man @@ -67,8 +67,11 @@ _man() manpath="${manpath//://*man$sect/ } ${manpath//://*cat$sect/ }" fi + local IFS=$' \t\n' reset=$( shopt -p failglob ); shopt -u failglob # redirect stderr for when path doesn't exist COMPREPLY=( $( eval command ls "$manpath" 2>/dev/null ) ) + $reset + # weed out directory path names and paths to man pages COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) # strip suffix from man pages -- 1.8.3.1