mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix ${!} and ${$} throwing syntax error in here-document
The inclusion of the special parameter expansions ${!} and ${$} (including the braces) in a here-document caused a syntax error. Bug reported by @Saikiran-m on Github. src/cmd/ksh93/data/lexstates.c: sh_lexstate7[]: - Change the state for ! (33) and $ (36) from S_ERR to 0. State table 7 is for skipping over ${...}, so this avoids the S_ERR state being invoked in sh_lex() (lex.c) for these characters while skipping ${...} in a here-doc. src/cmd/ksh93/tests/heredoc.sh: - Test evaluating the braces expansion form for all special parameters (@ * # ! $ - ? 0) in a here-document. Fixes: https://github.com/ksh93/ksh/issues/127
This commit is contained in:
parent
f9c127e39e
commit
6575903d1d
2 changed files with 11 additions and 1 deletions
|
@ -274,7 +274,7 @@ static const char sh_lexstate7[256] =
|
|||
S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR,
|
||||
S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR,
|
||||
|
||||
S_ERR, S_ERR, S_ERR, S_MOD2, S_ERR, S_MOD2, S_ERR, S_ERR,
|
||||
S_ERR, 0, S_ERR, S_MOD2, 0, S_MOD2, S_ERR, S_ERR,
|
||||
S_ERR, S_ERR, S_MOD1, S_MOD1, S_ERR, S_MOD1, S_DOT, S_MOD2,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, S_MOD1, S_ERR, S_ERR, S_MOD1, S_ERR, S_MOD1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue