aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-10-18 11:46:35 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-10-18 11:46:35 +0200
commitf37eb3999bce2ea46fef0214e33279b81609e596 (patch)
treebef567d0a9fe53cd1397b9b8e1a97c994cdb6d5d /shell/hush_test
parent7673e7fda42a2665f8528d531e9596f264643149 (diff)
downloadbusybox-w32-f37eb3999bce2ea46fef0214e33279b81609e596.tar.gz
busybox-w32-f37eb3999bce2ea46fef0214e33279b81609e596.tar.bz2
busybox-w32-f37eb3999bce2ea46fef0214e33279b81609e596.zip
hush: fix handling of empty arguments
function old new delta builtin_exec 25 83 +58 parse_stream 2242 2261 +19 run_pipe 1782 1787 +5 static.pseudo_null_str - 3 +3 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/0 up/down: 85/0) Total: 85 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-misc/empty_args.right6
-rwxr-xr-xshell/hush_test/hush-misc/empty_args.tests9
-rw-r--r--shell/hush_test/hush-psubst/emptytick.right7
-rwxr-xr-xshell/hush_test/hush-psubst/emptytick.tests8
4 files changed, 26 insertions, 4 deletions
diff --git a/shell/hush_test/hush-misc/empty_args.right b/shell/hush_test/hush-misc/empty_args.right
new file mode 100644
index 000000000..38ed8b8be
--- /dev/null
+++ b/shell/hush_test/hush-misc/empty_args.right
@@ -0,0 +1,6 @@
1Null 0th arg:
2hush: can't execute '': No such file or directory
3127
4Null 1st arg:
50
6Null arg in exec:
diff --git a/shell/hush_test/hush-misc/empty_args.tests b/shell/hush_test/hush-misc/empty_args.tests
new file mode 100755
index 000000000..efce5494a
--- /dev/null
+++ b/shell/hush_test/hush-misc/empty_args.tests
@@ -0,0 +1,9 @@
1echo Null 0th arg:
2""
3echo $?
4echo Null 1st arg:
5# printf without args would print usage info
6printf ""
7echo $?
8echo Null arg in exec:
9exec printf ""
diff --git a/shell/hush_test/hush-psubst/emptytick.right b/shell/hush_test/hush-psubst/emptytick.right
index d4b70c58a..1f60ecfda 100644
--- a/shell/hush_test/hush-psubst/emptytick.right
+++ b/shell/hush_test/hush-psubst/emptytick.right
@@ -1,14 +1,17 @@
10 10
20 20
3hush: can't execute '': No such file or directory
30 40
5hush: can't execute '': No such file or directory
40 60
50 70
60 80
70 90
80 100
11hush: can't execute '': No such file or directory
90 120
13hush: can't execute '': No such file or directory
100 140
110 150
120 160
130 17hush: can't execute '': No such file or directory
140
diff --git a/shell/hush_test/hush-psubst/emptytick.tests b/shell/hush_test/hush-psubst/emptytick.tests
index af3a1836c..a269f025a 100755
--- a/shell/hush_test/hush-psubst/emptytick.tests
+++ b/shell/hush_test/hush-psubst/emptytick.tests
@@ -1,16 +1,20 @@
1true; ``; echo $? 1true; ``; echo $?
2false; ``; echo $? 2false; ``; echo $?
3# UNFIXED BUG. bash sets $? to 127:
3true; `""`; echo $? 4true; `""`; echo $?
5# bash sets $? to 127:
4false; `""`; echo $? 6false; `""`; echo $?
5true; ` `; echo $? 7true; ` `; echo $?
6false; ` `; echo $? 8false; ` `; echo $?
7 9
8true; $(); echo $? 10true; $(); echo $?
9false; $(); echo $? 11false; $(); echo $?
12# bash sets $? to 127:
10true; $(""); echo $? 13true; $(""); echo $?
14# bash sets $? to 127:
11false; $(""); echo $? 15false; $(""); echo $?
12true; $( ); echo $? 16true; $( ); echo $?
13false; $( ); echo $? 17false; $( ); echo $?
14 18
15true; exec ''; echo $? 19exec ''; echo $?
16false; exec ''; echo $? 20echo Not reached