From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10280 invoked from network); 9 May 2001 16:59:48 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 May 2001 16:59:48 -0000 Received: (qmail 10366 invoked by alias); 9 May 2001 16:59:42 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14284 Received: (qmail 10347 invoked from network); 9 May 2001 16:59:41 -0000 From: "Bart Schaefer" Message-Id: <1010509165846.ZM13121@candle.brasslantern.com> Date: Wed, 9 May 2001 16:58:45 +0000 X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: One last _values / compvalues nit, and a nasty crash bug MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii First the nit: I don't expect anyone to leap to do anything about this, but now that we have both -S and -s (and it's too bad their meanings aren't reversed as the string given to -s is the one that has to be passed to compadd -S, but it's too late for that now) the issue arises of what happens when you pass the same string to both. E.g.: zsh% _tv() { _values -S : -s : test 'a: :(foo)' b } zsh% compedef _tv : zsh% : a zsh% : a: zsh% : a:b At this point, the thing that comes after `a:' should have been considered an argument, not a new value. If the argument to `a' is required rather than optional, there's no reason the same separator can't be used both between the value and its argument, and between the argument and the next value. Now the bug -- press TAB three times after `: a' and get a crash: schaefer<501> function _tv { _values -S '' -s : 'a: :(foo)' b } schaefer<502> compdef _tv : schaefer<503> function _tv { _values -S '' -s : test 'a: :(foo)' b } schaefer<504> : afoo:afoo:BUG: attempt to free more than allocated. _values:149: command not found: 0R^O^H\M-^?\M-^?\M-^?\M-^?@T^O^H\M-^?\M-^?\M-^?\M-^?pR^O^H\M-^?\M-^?\M-^?\M-^?\M-@S^O^H\M-^?\M-^?\M-^?\M-^?\M-pP^O^H\M-^?\M-^?\M-^?\M-^?ws zsh: segmentation fault (core dumped) zsh-4.0.1-pre-4 -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net