diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-16 13:52:32 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-16 13:52:32 +0200 |
commit | 29082231d0cb1a5b327de5d515b16f332d4dbdaf (patch) | |
tree | d0e3091e7d5244f555a16d3967dacad2ff8ba7e7 /shell/hush_test | |
parent | 202a2d121905a6245cdf7441c9f83ff213b5502e (diff) | |
download | busybox-w32-29082231d0cb1a5b327de5d515b16f332d4dbdaf.tar.gz busybox-w32-29082231d0cb1a5b327de5d515b16f332d4dbdaf.tar.bz2 busybox-w32-29082231d0cb1a5b327de5d515b16f332d4dbdaf.zip |
hush: fix multimple dependent variable expansion cases
function old new delta
get_local_var_value 100 171 +71
expand_assignments 46 76 +30
reset_traps_to_defaults 229 238 +9
maybe_set_to_sigexit 47 50 +3
init_sigmasks 211 214 +3
builtin_trap 462 465 +3
expand_vars_to_list 2412 2408 -4
run_pipe 1568 1533 -35
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 6/2 up/down: 119/-39) Total: 80 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r-- | shell/hush_test/hush-vars/var_serial.right | 5 | ||||
-rwxr-xr-x | shell/hush_test/hush-vars/var_serial.tests | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/shell/hush_test/hush-vars/var_serial.right b/shell/hush_test/hush-vars/var_serial.right new file mode 100644 index 000000000..42aa33057 --- /dev/null +++ b/shell/hush_test/hush-vars/var_serial.right | |||
@@ -0,0 +1,5 @@ | |||
1 | Assignments only: c=a | ||
2 | Assignments and a command: c=a | ||
3 | Assignments and a builtin: c=a | ||
4 | Assignments and a function: c=a | ||
5 | Done | ||
diff --git a/shell/hush_test/hush-vars/var_serial.tests b/shell/hush_test/hush-vars/var_serial.tests new file mode 100755 index 000000000..6b4a4cdf7 --- /dev/null +++ b/shell/hush_test/hush-vars/var_serial.tests | |||
@@ -0,0 +1,22 @@ | |||
1 | a=a | ||
2 | |||
3 | b=b | ||
4 | c=c | ||
5 | # Second assignment depends on the first: | ||
6 | b=$a c=$b | ||
7 | echo Assignments only: c=$c | ||
8 | |||
9 | b=b | ||
10 | c=c | ||
11 | b=$a c=$b "$THIS_SH" -c 'echo Assignments and a command: c=$c' | ||
12 | |||
13 | b=b | ||
14 | c=c | ||
15 | b=$a c=$b eval 'echo Assignments and a builtin: c=$c' | ||
16 | |||
17 | b=b | ||
18 | c=c | ||
19 | f() { echo Assignments and a function: c=$c; } | ||
20 | b=$a c=$b f | ||
21 | |||
22 | echo Done | ||