Closed GoogleCodeExporter closed 8 years ago
Original comment by fvu...@gmail.com
on 28 Sep 2008 at 8:48
The original bash_completion of Ian Macdonald tries to prevent
sourcing twice in two ways:
1. By declaring `BASH_COMPLETION' and `BASH_COMPLETION_DIR' readonly. Trying
to
assign to them during a second run will effectively return to bash immediately
without sourcing the rest of the code:
32 {
33 # These declarations must go within braces in order to be able to silence
34 # readonly variable errors.
35 BASH_COMPLETION="${BASH_COMPLETION:-/etc/bash_completion}"
36 BASH_COMPLETION_DIR="${BASH_COMPLETION_DIR:=/etc/bash_completion.d}"
37 } 2>/dev/null || :
38 readonly BASH_COMPLETION BASH_COMPLETION_DIR
2. By sourcing a wrapper file `bash_completion.sh' containing a check for
`BASH_COMPLETION':
3 # Check for bash (and that we haven't already been sourced).
4 [ -z "$BASH_VERSION" -o -n "$BASH_COMPLETION" ] && return
The first method with the `readonly' trick, gave troubles with a certain
bash-patch.
See: https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/149527
Original comment by fvu...@gmail.com
on 28 Sep 2008 at 8:55
If `COMP_VERSION' is non-empty, bash_completion_lib returns immediately without
loading any completions. Fixed in r58.
Original comment by fvu...@gmail.com
on 1 Oct 2008 at 7:59
Original issue reported on code.google.com by
fvu...@gmail.com
on 28 Sep 2008 at 8:46