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

Bug in built-in 'test' under cont $CONTEXT



Hi all,

I found a bug in builtin test command under $CONTEXT=="cont".

Using builtin test command via zle widget when zsh is pending for "for",
the shell fails with segmentation fault. This does not occur when using
/usr/bin/test instead, so I guess it is a problem of zsh.

REPRO:
% zsh -f
myhost% source zshrc_segv

myhost% for i in;    [test2 called]
for> do    [test2 called]
for> echo    [test2 called]
for> done    [test2 called]

myhost% for i in;    [test1 called]
for> do    [test1 called]
for> echo    [test1 called]
zsh: segmentation fault  zsh -f


% cat zshrc_segv
function test1 {
  # calling in $CONTEXT=cont will crash zsh
  echo -n '    [test1 called]'
  test -n ""
}
function test2 {
  # but this won't
  echo -n '    [test2 called]'
  /usr/bin/test -n ""
}
zle -N test1
zle -N test2
bindkey '^T' test1
bindkey '^[t' test2


VERSION: (ubuntu server 8.04 x86)
zsh 4.3.4 (i686-pc-linux-gnu)


--
Takahiro Suzuki



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