- _man(): quote $manpath to avoid premature expansion and remove local
variable $i
This commit is contained in:
parent
e2f04f8fd1
commit
bd5f78e80e
@ -1,6 +1,6 @@
|
|||||||
# bash_completion - some programmable completion functions for bash 2.05a
|
# bash_completion - some programmable completion functions for bash 2.05a
|
||||||
#
|
#
|
||||||
# $Id: bash_completion,v 1.163 2002/02/27 16:59:49 ianmacd Exp $
|
# $Id: bash_completion,v 1.164 2002/02/27 22:36:10 ianmacd Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||||
#
|
#
|
||||||
@ -281,7 +281,7 @@ _insmod()
|
|||||||
[ $OS = Linux ] &&
|
[ $OS = Linux ] &&
|
||||||
_man()
|
_man()
|
||||||
{
|
{
|
||||||
local cur prev sect i manpath
|
local cur prev sect manpath
|
||||||
|
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur=${COMP_WORDS[COMP_CWORD]}
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
@ -312,7 +312,7 @@ _man()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# redirect stderr for when path doesn't exist
|
# redirect stderr for when path doesn't exist
|
||||||
COMPREPLY=( $( eval ls $manpath 2>/dev/null ) )
|
COMPREPLY=( $( eval ls "$manpath" 2>/dev/null ) )
|
||||||
# weed out directory path names and paths to man pages
|
# weed out directory path names and paths to man pages
|
||||||
COMPREPLY=( ${COMPREPLY[@]##*/?(:)} )
|
COMPREPLY=( ${COMPREPLY[@]##*/?(:)} )
|
||||||
# strip suffix from man pages
|
# strip suffix from man pages
|
||||||
|
Loading…
x
Reference in New Issue
Block a user