zsh-workers
 help / color / mirror / code / Atom feed
* Bug in zsh-3.1.5
@ 1998-11-07  9:20 Martin Birgmeier
  1998-11-07 17:55 ` Bart Schaefer
  1998-11-10  8:59 ` PATCH: Re: Bug in zsh-3.1.5 `case' pattern matching Peter Stephenson
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Birgmeier @ 1998-11-07  9:20 UTC (permalink / raw)
  To: zsh-workers

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@IEEE.org
Austria                                   Martin.Birgmeier@aon.at


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

end of thread, other threads:[~1998-11-10  9:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-07  9:20 Bug in zsh-3.1.5 Martin Birgmeier
1998-11-07 17:55 ` Bart Schaefer
1998-11-10  8:59 ` PATCH: Re: Bug in zsh-3.1.5 `case' pattern matching Peter Stephenson

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).