Quoted $cur to prevent globbing

See Alioth #311614
This commit is contained in:
Freddy Vulto 2009-09-28 20:21:54 +02:00
parent 1453625e50
commit e6a18ac7cf
2 changed files with 2 additions and 2 deletions

View File

@ -960,7 +960,7 @@ _insmod()
[[ "${COMP_WORDS[COMP_CWORD-1]}" != -* ]]; then
# do module parameter completion
COMPREPLY=( $( /sbin/modinfo -p ${COMP_WORDS[1]} 2>/dev/null | \
awk '{if ($1 ~ /^parm:/ && $2 ~ /^'$cur'/) { print $2 } \
awk '{if ($1 ~ /^parm:/ && $2 ~ /^'"$cur"'/) { print $2 } \
else if ($1 !~ /:/ && $1 ~ /^'"$cur"'/) { print $1 }}' ) )
else
_modules $(uname -r)

View File

@ -18,7 +18,7 @@ _alias()
;;
*=)
COMPREPLY=( "$( alias ${cur%=} 2>/dev/null | \
sed -e 's|^alias '$cur'\(.*\)$|\1|' )" )
sed -e 's|^alias '"$cur"'\(.*\)$|\1|' )" )
;;
esac
}