From cb6ff25afeb2daeebcb435c9766215061d3c75cb Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 4 May 2009 00:14:30 +0200 Subject: hush: fix bug where in "var=val func" var's value is not visible in func function old new delta unset_local_var - 168 +168 set_vars_all_and_save_old - 87 +87 get_ptr_to_local_var - 77 +77 free_strings_and_unset - 53 +53 builtin_export 266 274 +8 get_local_var_value 31 33 +2 putenv_all 27 - -27 free_strings_and_unsetenv 53 - -53 get_local_var 68 - -68 run_list 2475 2350 -125 builtin_unset 380 220 -160 ------------------------------------------------------------------------------ (add/remove: 4/3 grow/shrink: 2/2 up/down: 395/-433) Total: -38 bytes Signed-off-by: Denys Vlasenko --- shell/hush_test/hush-misc/env_and_func.right | 2 ++ shell/hush_test/hush-misc/env_and_func.tests | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 shell/hush_test/hush-misc/env_and_func.right create mode 100755 shell/hush_test/hush-misc/env_and_func.tests (limited to 'shell/hush_test/hush-misc') diff --git a/shell/hush_test/hush-misc/env_and_func.right b/shell/hush_test/hush-misc/env_and_func.right new file mode 100644 index 000000000..4a1545058 --- /dev/null +++ b/shell/hush_test/hush-misc/env_and_func.right @@ -0,0 +1,2 @@ +var=val +var=old diff --git a/shell/hush_test/hush-misc/env_and_func.tests b/shell/hush_test/hush-misc/env_and_func.tests new file mode 100755 index 000000000..1d4eaf3a7 --- /dev/null +++ b/shell/hush_test/hush-misc/env_and_func.tests @@ -0,0 +1,4 @@ +var=old +f() { echo "var=$var"; } +var=val f +echo "var=$var" -- cgit v1.2.3