summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2009-04-26 20:06:14 +0000
committerDenis Vlasenko2009-04-26 20:06:14 +0000
commit572930027d5d86a18ebd68d5f4273150a2f302e1 (patch)
tree67f35d015b39c678bc3d2e271c956b6e356fa0d4
parent5b7589eb27e748a3d281c0341219cf7435e8b4f1 (diff)
downloadbusybox-572930027d5d86a18ebd68d5f4273150a2f302e1.zip
busybox-572930027d5d86a18ebd68d5f4273150a2f302e1.tar.gz
hush: nommu fix for function passing
-rw-r--r--shell/hush.c5
-rw-r--r--shell/hush_test/hush-misc/func4.right2
-rwxr-xr-xshell/hush_test/hush-misc/func4.tests7
-rwxr-xr-xshell/hush_test/hush-z_slow/leak_all1.tests2
4 files changed, 15 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 2ad8eba..292b8b2 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -5328,9 +5328,12 @@ static int parse_stream_dquoted(o_string *as_string,
* within double quotes by preceding it with a backslash.
*/
if (strchr("$`\"\\", next) != NULL) {
- o_addqchr(dest, i_getch(input));
+ ch = i_getch(input);
+ o_addqchr(dest, ch);
+ nommu_addchr(as_string, ch);
} else {
o_addqchr(dest, '\\');
+ nommu_addchr(as_string, '\\');
}
goto again;
}
diff --git a/shell/hush_test/hush-misc/func4.right b/shell/hush_test/hush-misc/func4.right
new file mode 100644
index 0000000..0c87e31
--- /dev/null
+++ b/shell/hush_test/hush-misc/func4.right
@@ -0,0 +1,2 @@
+24
+Done
diff --git a/shell/hush_test/hush-misc/func4.tests b/shell/hush_test/hush-misc/func4.tests
new file mode 100755
index 0000000..db3f15a
--- /dev/null
+++ b/shell/hush_test/hush-misc/func4.tests
@@ -0,0 +1,7 @@
+func() {
+ eval "echo \"\${val_${1}}\""
+}
+
+val_x=24
+(func x)
+echo Done
diff --git a/shell/hush_test/hush-z_slow/leak_all1.tests b/shell/hush_test/hush-z_slow/leak_all1.tests
index 17ce0c6..4e3c4fd 100755
--- a/shell/hush_test/hush-z_slow/leak_all1.tests
+++ b/shell/hush_test/hush-z_slow/leak_all1.tests
@@ -67,6 +67,7 @@ HERE
f >/dev/null
: $((i++))
done
+unset i l t
unset -f f
memleak
@@ -134,6 +135,7 @@ HERE
f >/dev/null
: $((i++))
done
+unset i l t
unset -f f