From 8286513838beaf9ccaab15bb5905248c3b7b8a69 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 29 Sep 2016 16:59:06 +0200 Subject: hush: rework input char buffering to allow more than one-deep peek This fixes backslash+newline continuation in $VAR\ NAME construct. (ash has a bug there as well). function old new delta file_peek2 - 74 +74 parse_dollar 746 773 +27 expand_vars_to_list 1143 1167 +24 setup_string_in_str 32 46 +14 setup_file_in_str 33 47 +14 file_get 264 278 +14 static_peek2 - 7 +7 file_peek 91 72 -19 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 5/1 up/down: 174/-19) Total: 155 bytes Signed-off-by: Denys Vlasenko --- shell/ash_test/ash-vars/var_serial.tests | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 shell/ash_test/ash-vars/var_serial.tests (limited to 'shell/ash_test/ash-vars/var_serial.tests') diff --git a/shell/ash_test/ash-vars/var_serial.tests b/shell/ash_test/ash-vars/var_serial.tests new file mode 100755 index 000000000..6b4a4cdf7 --- /dev/null +++ b/shell/ash_test/ash-vars/var_serial.tests @@ -0,0 +1,22 @@ +a=a + +b=b +c=c +# Second assignment depends on the first: +b=$a c=$b +echo Assignments only: c=$c + +b=b +c=c +b=$a c=$b "$THIS_SH" -c 'echo Assignments and a command: c=$c' + +b=b +c=c +b=$a c=$b eval 'echo Assignments and a builtin: c=$c' + +b=b +c=c +f() { echo Assignments and a function: c=$c; } +b=$a c=$b f + +echo Done -- cgit v1.2.3