[BUG] case fails since 0.5.13.2

Nicolas Cavallari <[email protected]> Fri, 27 Mar 2026 15:28:13 +0100
Newsgroups org.kernel.vger.dash
Message-ID <[email protected]>
This syntax is accepted by all shells except dash 0.5.13.2:

case "$test" in
in) echo input;;
out) echo output;;
do) echo start;;
done) echo stop;;
esac

on dash 0.5.13.2, it fails with "Syntax error: "in" unexpected (expecting word)".
Reverting e8c0324af64c("parser: Catch bogus case patterns") fixes it.

POSIX says that only esac should be recognized as a keyword when parsing the 
first pattern of a case.

An example of a real script broken by this change:

https://salsa.debian.org/debian/netplug/-/blob/debian/unstable/scripts/netplug?ref_type=heads