Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
bug with hidden prefixes
- X-seq: zsh-workers 35443
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: bug with hidden prefixes
- Date: Thu, 11 Jun 2015 14:09:37 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1434024578; bh=d7ysW+hfMJXtmLgSI+X5cB4EUmu/wkw1f0Z2qS4Ah7A=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=E2kT8N/2VJuu6WChECe8SDnjQHUuzt0VQrE0pdzdY2Ck/blf3OAuN2pYzgqZwG6FXPdydVzJvuRMqmTlq1olpDuJZpdY0CxSTB5aUpPV+YPPX4ILdLMo5z3tZbYRT33bcHALdRPMwiVTsRt5xLtx8rDEaR6Xx/uxmVjPUtYIcTQY8ZabmOCMFrYwIAKrIZJQq5XsLGkDWyEeZdqpO1Iee8OkACHdZ5zE0LaxM0N9Kr9EgwFVom96YBiJbtowQiWXJIvMUldptD8T3UFWU9zNblOCsiR4GtvvLcKBKsgJLwm+2dQEkWuH53RTNzbdXPbyv8KvokQbTXR4TpgDCGJt+g==
- In-reply-to: <18592.1433197179@thecus.kiddle.eu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <18592.1433197179@thecus.kiddle.eu>
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