mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix lexing of 'case' in do...done in a $(comsub) (rhbz#1241013)
The following caused a spurious syntax error:
$ x=$(for i in 1; do case $i in word) true;; esac; done)
-ksh: syntax error: `;;' unexpected
Prior discussion:
https://bugzilla.redhat.com/1241013
Original patch, backported from 93v- beta, applied without change:
642af4d6/f/ksh-20120801-parserfix.patch
This commit is contained in:
parent
bb15f7fb19
commit
bd283959be
4 changed files with 27 additions and 1 deletions
|
@ -716,5 +716,14 @@ else err_exit "warning: skipping argv rewrite test due to noncompliant 'ps' util
|
|||
let Errors--
|
||||
fi
|
||||
|
||||
# ======
|
||||
# https://bugzilla.redhat.com/1241013
|
||||
got=$(eval 'x=$(for i in test; do case $i in test) true;; esac; done)' 2>&1) \
|
||||
|| err_exit "case in a for loop inside a \$(comsub) caused syntax error (got $(printf %q "$got"))"
|
||||
got=$(eval 'x=${ for i in test; do case $i in test) true;; esac; done; }' 2>&1) \
|
||||
|| err_exit "case in a for loop inside a \${ comsub; } caused syntax error (got $(printf %q "$got"))"
|
||||
got=$(eval 'x=`for i in test; do case $i in test) true;; esac; done`' 2>&1) \
|
||||
|| err_exit "case in a for loop inside a \`comsub\` caused syntax error (got $(printf %q "$got"))"
|
||||
|
||||
# ======
|
||||
exit $((Errors<125?Errors:125))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue