When $COMP_CWORD == 1, and a directory (in ./) has the same name as one of the subcommands, _equery() will choose the directory over the subcommand. Eg: $ ecd vixie $ equery fil<TAB> ==> equery files/
genone just informed me of another equery completion bug; posting here as a reminder to myself, so I can kill both of these birdies with one stone. equery needs to recognize (but not necessarily complete on) the short subcommands (eg. belongs can also be 'b', changes -> 'c' and so forth).
Will be fixed next gentoo-bashcomp release.
pfft package name completion breakout is taking a lot longer than expected, so I went ahead and diff'd the equery fixes from HEAD. 20050121-r1 is in the tree.