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

Bug in zsh-3.1.5



Hi -

First, thanks for a great program!

Now, the bug report: I am using zsh-3.1.5 on FreeBSD 2.2.7. Since zsh-3.1.3, there
is a bug in case statement processing. Relevant output goes here:

$ echo echo "${HOSTTYPE:-$OSTYPE}:${TERM}:${TTY}"       <--- informational
freebsd2.2.7:xterm:/dev/ttyp0

$ case a in                                             <--- works
a* | b* )
echo yes
;;
* )
echo no
;;
esac
yes

$ case "${HOSTTYPE:-$OSTYPE}:${TERM}:${TTY}" in         <--- works
freebsd*:xterm:* )
echo yes
;;
* )
echo no
;;
case> esac
yes

$ case "${HOSTTYPE:-$OSTYPE}:${TERM}:${TTY}" in        <--- DOES NOT WORK
freebsd*:xterm:* | freebsd*:xterms:* )
echo yes
;;
* )
echo no
;;
esac
no

It seems that the second choice of the first case label controls the truth
value of the expression!

$ case "${HOSTTYPE:-$OSTYPE}:${TERM}:${TTY}" in       <--- WORKS!
( freebsd*:xterm:* | freebsd*:xterms:* )
echo yes
;;
* )
echo no
;;
esac
yes

The last example shows that the problem must have something to do with
a new allowed syntax for case labels (leading parenthesis). Also, the
first example shows that the case statement is working if patterns are
quite simple.

I hope you can reproduce and fix this problem. I did not include
the output of "reporter" since I am quite confident that you don't
need it. If I am wrong, I'll mail it to you, just let me know.

Please note that I am not on the mailing list.

Best regards,

Martin

-- 
Martin Birgmeier

Vienna                            e-mail: Martin.Birgmeier@xxxxxxxx
Austria                                   Martin.Birgmeier@xxxxxx



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