diff options
author | Oliver Kiddle <okiddle@yahoo.co.uk> | 2019-05-23 01:05:01 +0200 |
---|---|---|
committer | Oliver Kiddle <okiddle@yahoo.co.uk> | 2019-05-23 01:05:01 +0200 |
commit | a531a1ec2dce97c1507a45abd4795b1aea1edc9e (patch) | |
tree | 203061ecef2661089618926a0923a0aa213c33e5 /Test | |
parent | 3de2333b0821a1aaeb3ef98046212b5bf22b596c (diff) | |
download | zsh-a531a1ec2dce97c1507a45abd4795b1aea1edc9e.tar.gz zsh-a531a1ec2dce97c1507a45abd4795b1aea1edc9e.tar.xz zsh-a531a1ec2dce97c1507a45abd4795b1aea1edc9e.zip |
44345: fix wordcode traversal where ! without a following command could result in a crash
Diffstat (limited to 'Test')
-rw-r--r-- | Test/A01grammar.ztst | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index 1ed3cb6b7..c8600d4cb 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -76,6 +76,39 @@ 0:Basic current shell list with error >false + fn() { : && ! ; : } + functions -x3 fn + fn +0:End of sublist containing ! with no command +>fn () { +> : && ! +> : +>} + + if [[ m -eq y ]]; then + : && ! + : + fi +0:! followed by no further commands + + fn() { ! {!} && ! (!) || ! {!} } + functions -x2 fn + fn +0:exclamation marks without following commands +>fn () { +> ! { +> ! +> } && ! ( +> ! +> ) || ! { +> ! +> } +>} + + ! | true +1:! followed by no command but by a pipe +?(eval):1: parse error near `|' + # # Tests for `Precommand Modifiers' # |