You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Add relative paths to COMPREPLY
if [[ $cur && $cur != /* ]]; then
local realcur
[[ $cur == */ ]] && # don't let readlink drop last / from path
realcur="$(readlink -f "$cur." 2>/dev/null)/" ||
realcur=$(readlink -f "$cur" 2>/dev/null)
if [[ $realcur ]]; then
local dirrealcur="" dircur="" basecur
if [[ $cur == */* ]]; then
dirrealcur="${realcur%/*}/"
dircur="${cur%/*}/"
fi
basecur=${cur#"$dircur"}
local i
for i in ${!COMPREPLY[*]}; do
[[ ${COMPREPLY[i]} == "$realcur"* ]] &&
_comp_compgen -aC "$dircur" -c "$basecur" -- \
-f -d -P "$dircur" -X "!${COMPREPLY[i]##"$dirrealcur"}"
done
fi
fi
In the above code, when executing the _comp_compgen -aC '$dircur' -c '$basecur' command, the value of the dircur variable is empty. This causes _comp_compgen to consider it an invalid argument, resulting in an error.
C)
if [[ ! $OPTARG ]]; then
printf 'bash_completion: %s: -C: invalid directory name `%s'\''\n' "$FUNCNAME" "$OPTARG" >&2
return 2
fi
_dir=$OPTARG
;;
The text was updated successfully, but these errors were encountered:
Describe the bug
When completing the
umount o
command, the following error occurred:To reproduce
The problematic version is
bash-completion-2.12
Expected behavior
Versions (please complete the following information)
Additional context
The issue was introduced after feat(_comp_compgen): support option -C
Debug trace
In the above code, when executing the
_comp_compgen -aC '$dircur' -c '$basecur'
command, the value of thedircur
variable is empty. This causes_comp_compgen
to consider it an invalid argument, resulting in an error.The text was updated successfully, but these errors were encountered: