zsh-workers
 help / color / mirror / code / Atom feed
* One last _values / compvalues nit, and a nasty crash bug
@ 2001-05-09 16:58 Bart Schaefer
  2001-05-10  8:50 ` Sven Wischnowsky
  0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2001-05-09 16:58 UTC (permalink / raw)
  To: zsh-workers

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<TAB>
zsh% : a:<TAB>
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   


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-06-14  2:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-09 16:58 One last _values / compvalues nit, and a nasty crash bug Bart Schaefer
2001-05-10  8:50 ` Sven Wischnowsky
2001-06-08 15:31   ` Oliver Kiddle
2001-06-11 11:42     ` Sven Wischnowsky
2001-06-12 15:51       ` seg fault from _arguments Oliver Kiddle
2001-06-13 11:01         ` PATCH: " Sven Wischnowsky
2001-06-13 11:59           ` Oliver Kiddle
2001-06-14  2:53           ` Jos Backus

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).