Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

bug with hidden prefixes



On 2 Jun, I wrote:
> This _ttys function allows the /dev/ prefix to be optional, required or
> stripped. I think there's a bug somewhere in the hidden prefix handling
> that this shows up, however.

I'll just elaborate on this in case someone else has more success than
me in tracking this down. The bug exists even in zsh 3.1.7 so is not
something that got introduced later. The following are the minimal steps
to reproduce it:

_foo() {
  local ret=1
  compadd -p /dev/ -M 'r:|/=* r:|=*' one two && ret=0
  compadd three && ret=0
  return ret
}
compdef _foo foo
foo /d<tab>

This should insert /dev/ because it is an unambiguous prefix to both
possible matches: three can be ruled out. The two matches are listed, it
is just that the prefix is not inserted. Without either the matching
control or the third match being there, it works.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author