Fix _filedir on bash 4.

We don't need to double-quote things for compgen w/ bash 4. Just putting
each file in double quotes is sufficient.

See: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00155.html
This commit is contained in:
Mike Kelly 2009-04-02 11:16:46 -04:00
parent 27daafa76f
commit 1421e55aac

View File

@ -209,6 +209,12 @@ quote()
# results in the original argument # results in the original argument
quote_readline() quote_readline()
{ {
if [[ "${BASH_VERSINFO[0]}" -ge 4 ]] ; then
# This function isn't really necessary on bash 4
# See: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00155.html
echo "${1}"
return
fi
local t="${1//\\/\\\\}" local t="${1//\\/\\\\}"
echo \'${t//\'/\'\\\'\'}\' #'# Help vim syntax highlighting echo \'${t//\'/\'\\\'\'}\' #'# Help vim syntax highlighting
} }