hush: fix improper handling of newline and hash chars in few corner cases
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
2
shell/hush_test/hush-misc/assignment3.right
Normal file
2
shell/hush_test/hush-misc/assignment3.right
Normal file
@@ -0,0 +1,2 @@
|
||||
Done:0
|
||||
abc=123
|
5
shell/hush_test/hush-misc/assignment3.tests
Executable file
5
shell/hush_test/hush-misc/assignment3.tests
Executable file
@@ -0,0 +1,5 @@
|
||||
# This must be interpreted as assignments
|
||||
a=1 b\
|
||||
=2 c=3
|
||||
echo Done:$?
|
||||
echo abc=$a$b$c
|
2
shell/hush_test/hush-parsing/comment1.right
Normal file
2
shell/hush_test/hush-parsing/comment1.right
Normal file
@@ -0,0 +1,2 @@
|
||||
Nothing:
|
||||
String: #should-be-echoed
|
2
shell/hush_test/hush-parsing/comment1.tests
Executable file
2
shell/hush_test/hush-parsing/comment1.tests
Executable file
@@ -0,0 +1,2 @@
|
||||
echo Nothing: #should-not-be-echoed
|
||||
echo String: ""#should-be-echoed
|
1
shell/hush_test/hush-parsing/eol1.right
Normal file
1
shell/hush_test/hush-parsing/eol1.right
Normal file
@@ -0,0 +1 @@
|
||||
Done:0
|
18
shell/hush_test/hush-parsing/eol1.tests
Executable file
18
shell/hush_test/hush-parsing/eol1.tests
Executable file
@@ -0,0 +1,18 @@
|
||||
# bug was that we treated <newline> as ';' in this line:
|
||||
true || echo foo |
|
||||
echo BAD1 | cat
|
||||
|
||||
# variation on the same theme
|
||||
true || echo foo |
|
||||
# comment
|
||||
echo BAD2 | cat
|
||||
|
||||
# variation on the same theme
|
||||
true || echo foo |
|
||||
|
||||
echo BAD3 | cat
|
||||
|
||||
# this should error out, but currently works in hush:
|
||||
#true || echo foo |;
|
||||
|
||||
echo Done:$?
|
Reference in New Issue
Block a user