Package: bash
Version: 4.3-1
Severity: normal
Affects: bash-completion
Found: bash/4.3-2

After upgrading bash to version 4.3-2, when pressing <tab> on a blank line,
bash-completion reports:
words: bad array subscript

I tried emptying /usr/share/bash-completion/completions but the problem
persists.

If I set -x, I get these messages:
+ local cur prev words cword split
+ _init_completion -s
+ local exclude= flag outx errx inx OPTIND=1
+ getopts n:e:o:i:s flag -s
+ case $flag in
+ split=false
+ exclude+==
+ getopts n:e:o:i:s flag -s
+ COMPREPLY=()
+ local 'redir=@(?([0-9])<|?([0-9&])>?(>)|>&)'
+ _get_comp_words_by_ref -n '=<>&' cur prev words cword
+ local exclude flag i OPTIND=1
+ words=()
+ local cur cword words
+ upargs=()
+ upvars=()
+ local upargs upvars vcur vcword vprev vwords
+ getopts c:i:n:p:w: flag -n '=<>&' cur prev words cword
+ case $flag in
+ exclude='=<>&'
+ getopts c:i:n:p:w: flag -n '=<>&' cur prev words cword
+ [[ 6 -ge 3 ]]
+ case ${!OPTIND} in
+ vcur=cur
+ let 'OPTIND += 1'
+ [[ 6 -ge 4 ]]
+ case ${!OPTIND} in
+ vprev=prev
+ let 'OPTIND += 1'
+ [[ 6 -ge 5 ]]
+ case ${!OPTIND} in
+ vwords=words
+ let 'OPTIND += 1'
+ [[ 6 -ge 6 ]]
+ case ${!OPTIND} in
+ vcword=cword
+ let 'OPTIND += 1'
+ [[ 6 -ge 7 ]]
+ __get_cword_at_cursor_by_ref '=<>&' words cword cur
+ words=()
+ local cword words
+ __reassemble_comp_words_by_ref '=<>&' words cword
+ local exclude i j line ref
+ [[ -n =<>& ]]
+ exclude='=<>&'
+ eval cword=-1
++ cword=-1
+ [[ -n =<>& ]]
+ line=
+ (( i=0, j=0 ))
+ (( i < 0 ))
+ [[ 0 == -1 ]]
+ local i cur index=0 lead=
+ [[ 0 -gt 0 ]]
+ local words cword cur
+ _upvars -a0 words -v cword -1 -v cur ''
+ ((  8  ))
+ ((  8  ))
+ case $1 in
+ [[ -n 0 ]]
+ printf %d 0
+ [[ -n words ]]
+ unset -v words
+ eval 'words=("${@:3:0}")'
++ words=("${@:3:0}")
+ shift 2
+ ((  6  ))
+ case $1 in
+ [[ -n cword ]]
+ unset -v cword
+ eval 'cword="$3"'
++ cword=-1
+ shift 3
+ ((  3  ))
+ case $1 in
+ [[ -n cur ]]
+ unset -v cur
+ eval 'cur="$3"'
++ cur=
+ shift 3
+ ((  0  ))
+ [[ -n cur ]]
+ upvars+=("$vcur")
+ upargs+=(-v $vcur "$cur")
+ [[ -n cword ]]
+ upvars+=("$vcword")
+ upargs+=(-v $vcword "$cword")
+ [[ -n prev ]]
+ [[ -1 -ge 1 ]]
+ [[ -n words ]]
+ upvars+=("$vwords")
+ upargs+=(-a${#words[@]} $vwords "${words[@]}")
+ ((  3  ))
+ local cur cword words
+ _upvars -v cur '' -v cword -1 -a0 words
+ ((  8  ))
+ ((  8  ))
+ case $1 in
+ [[ -n cur ]]
+ unset -v cur
+ eval 'cur="$3"'
++ cur=
+ shift 3
+ ((  5  ))
+ case $1 in
+ [[ -n cword ]]
+ unset -v cword
+ eval 'cword="$3"'
++ cword=-1
+ shift 3
+ ((  2  ))
+ case $1 in
+ [[ -n 0 ]]
+ printf %d 0
+ [[ -n words ]]
+ unset -v words
+ eval 'words=("${@:3:0}")'
++ words=("${@:3:0}")
+ shift 2
+ ((  0  ))
+ _variables
+ [[ '' =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]]
+ return 1
+ [[ '' == @(?([0-9])<|?([0-9&])>?(>)|>&)* ]]
+ [[ '' == @(?([0-9])<|?([0-9&])>?(>)|>&) ]]
+ local i skip
+ (( i=1 ))
+ (( i < 0 ))
+ [[ -1 -eq 0 ]]
-su: words: bad array subscript
+ prev=
+ [[ -n false ]]
+ _split_longopt
+ [[ '' == --?*=* ]]
+ return 1
+ return 0
+ false
+ _filedir
+ local i 'IFS=
' xspec
+ _tilde ''
+ local result=0
+ [[ '' == \~* ]]
+ return 0
+ local -a toks
+ local quoted x tmp
+ _quote_readline_by_ref '' quoted
+ [[ '' == \'* ]]
+ printf -v quoted %q ''
+ [[ '' == \$* ]]
++ compgen -d -- ''\'''\'''
+ x='completions
completions.ok
helpers'
+ read -r tmp
+ toks+=("$tmp")
+ read -r tmp
+ toks+=("$tmp")
+ read -r tmp
+ toks+=("$tmp")
+ read -r tmp
+ [[ '' != -d ]]
+ xspec=
++ compgen -f -X '' -- ''\'''\'''
+ x=
+ [[ -n '' ]]
+ [[ 3 -ne 0 ]]
+ compopt -o filenames
+ COMPREPLY+=("${toks[@]}")

So this occurs in /usr/share/bash-completion/bash_completion on line
711.

Downgrading bash to version 4.2+dfsg-1 fixes the problem.


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.12-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bash depends on:
ii  base-files   7.2
ii  dash         0.5.7-4
ii  debianutils  4.4
ii  libc6        2.18-4
ii  libtinfo5    5.9+20140118-1

Versions of packages bash recommends:
ii  bash-completion  1:2.1-2

Versions of packages bash suggests:
pn  bash-doc  <none>

-- no debconf information

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to