File bash-completion-no_tilde_expansion.patch of Package bash-completion
Index: bash_completion/bash_completion
===================================================================
--- bash_completion.orig/bash_completion
+++ bash_completion/bash_completion
@@ -189,8 +189,6 @@ _filedir()
{
local IFS=$'\t\n' xspec #glob
- _expand || return 0
-
#glob=$(set +o|grep noglob) # save glob setting.
#set -f # disable pathname expansion (globbing)
@@ -268,23 +266,6 @@ _available_interfaces()
sed -ne 's|^\('$cur'[^[:space:][:punct:]]\{1,\}\).*$|\1|p') )
}
-# This function expands tildes in pathnames
-#
-_expand()
-{
- [ "$cur" != "${cur%\\}" ] && cur="$cur\\"
-
- # expand ~username type directory specifications
- if [[ "$cur" == \~*/* ]]; then
- eval cur=$cur
-
- elif [[ "$cur" == \~* ]]; then
- cur=${cur#\~}
- COMPREPLY=( $( compgen -P '~' -u $cur ) )
- return ${#COMPREPLY[@]}
- fi
-}
-
# This function completes on process IDs.
# AIX and Solaris ps prefers X/Open syntax.
[ $UNAME = SunOS -o $UNAME = AIX ] &&
@@ -762,8 +743,6 @@ _man()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
- _expand || return 0
-
# default completion if parameter contains /
if [[ "$cur" == */* ]]; then
_filedir
@@ -966,8 +945,6 @@ _find()
;;
esac
- _expand || return 0
-
# set exprfound to 1 if there is already an expression present
for i in ${COMP_WORDS[@]}; do
[[ "$i" = [-\(\),\!]* ]] && exprfound=1 && break
@@ -2575,8 +2552,6 @@ _scp()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
- _expand || return 0
-
if [[ "$cur" == *:* ]]; then
# remove backslash escape from :
cur=${cur/\\:/:}
@@ -2618,8 +2593,6 @@ _rsync()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
- _expand || return 0
-
case "$prev" in
--@(config|password-file|include-from|exclude-from))
_filedir
@@ -3315,8 +3288,6 @@ _gzip()
xspec=
fi
- _expand || return 0
-
COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \
$( compgen -d -- $cur ) )
} &&
@@ -3353,8 +3324,6 @@ _bzip2()
[[ "$prev" == -*z* ]] && xspec=
fi
- _expand || return 0
-
COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \
$( compgen -d -- $cur ) )
} &&
@@ -4148,8 +4117,6 @@ _gcc()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
- _expand || return 0
-
case "$1" in
gcj)
backend=jc1
@@ -4226,8 +4193,6 @@ _dpkg()
prev=${COMP_WORDS[COMP_CWORD-1]}
i=$COMP_CWORD
- _expand || return 0
-
# find the last option flag
if [[ $cur != -* ]]; then
while [[ $prev != -* && $i != 1 ]]; do
@@ -6783,8 +6748,6 @@ _dd()
;;
esac
- _expand || return 0
-
COMPREPLY=( $( compgen -W '--help --version' -- $cur ) \
$( compgen -W 'bs cbs conv count ibs if obs of seek skip'\
-S '=' -- $cur ) )
@@ -6938,8 +6901,6 @@ _info()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
- _expand || return 0
-
# default completion if parameter contains /
if [[ "$cur" == */* ]]; then
_filedir
@@ -9244,8 +9205,6 @@ _filedir_xspec()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
- _expand || return 0
-
# get first exclusion compspec that matches this command
xspec=$( sed -ne $'/^complete .*[ \t]'${1##*/}$'\([ \t]\|$\)/{p;q;}' \
$BASH_COMPLETION )