- _cd(): trim leading './' from relative completions, since bash will see

'./foo' and 'foo' as two distinct completions and return both, even though
  the './' will be cropped when displaying them
This commit is contained in:
ianmacd 2002-03-08 18:46:15 +00:00
parent dbeb1401db
commit fc3c3bd9e0

View File

@ -1,6 +1,6 @@
# bash_completion - some programmable completion functions for bash 2.05a
#
# $Id: bash_completion,v 1.189 2002/03/08 18:26:41 ianmacd Exp $
# $Id: bash_completion,v 1.190 2002/03/08 19:46:15 ianmacd Exp $
#
# Copyright (C) Ian Macdonald <ian@caliban.org>
#
@ -1695,6 +1695,10 @@ _cd()
fi
IFS=$' \t\n'
_filedir -d
# remove leading ./ from completions
for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do
COMPREPLY[i]=${COMPREPLY[i]/#.\//}
done
return 0
}