summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-08-16 17:18:08 +0000
committerjilles <jilles@FreeBSD.org>2010-08-16 17:18:08 +0000
commit81d99cf50dae52dedc34eb662d6bff22a4454e04 (patch)
tree0b8c268bf929695bd269b4b35fcf2872055df49d /tools
parentdd1fff9bcb93c49e02a04bb712ecc2695db0c218 (diff)
downloadFreeBSD-src-81d99cf50dae52dedc34eb662d6bff22a4454e04.zip
FreeBSD-src-81d99cf50dae52dedc34eb662d6bff22a4454e04.tar.gz
sh: Get rid of unnecessary non-standard empty lists.
POSIX does not allow constructs like: if cmd; then fi { } Add a colon dummy command, except in a test that verifies that such empty lists do not cause crashes when used as a function definition.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/builtins/command3.01
-rw-r--r--tools/regression/bin/sh/builtins/command5.01
-rw-r--r--tools/regression/bin/sh/builtins/command6.01
-rw-r--r--tools/regression/bin/sh/execution/func2.01
-rw-r--r--tools/regression/bin/sh/set-e/elif1.02
-rw-r--r--tools/regression/bin/sh/set-e/elif2.02
-rw-r--r--tools/regression/bin/sh/set-e/if1.01
-rw-r--r--tools/regression/bin/sh/set-e/if3.01
-rw-r--r--tools/regression/bin/sh/set-e/while1.01
-rw-r--r--tools/regression/bin/sh/set-e/while2.01
10 files changed, 12 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/command3.0 b/tools/regression/bin/sh/builtins/command3.0
index f4ca120..9d4ae89 100644
--- a/tools/regression/bin/sh/builtins/command3.0
+++ b/tools/regression/bin/sh/builtins/command3.0
@@ -4,6 +4,7 @@ command -v true
command -v /bin/ls
fun() {
+ :
}
command -v fun
command -v break
diff --git a/tools/regression/bin/sh/builtins/command5.0 b/tools/regression/bin/sh/builtins/command5.0
index d94d2f4..13b3fe1 100644
--- a/tools/regression/bin/sh/builtins/command5.0
+++ b/tools/regression/bin/sh/builtins/command5.0
@@ -4,6 +4,7 @@ command -V true
command -V /bin/ls
fun() {
+ :
}
command -V fun
command -V break
diff --git a/tools/regression/bin/sh/builtins/command6.0 b/tools/regression/bin/sh/builtins/command6.0
index 2ba836e..0e6b5ee 100644
--- a/tools/regression/bin/sh/builtins/command6.0
+++ b/tools/regression/bin/sh/builtins/command6.0
@@ -5,6 +5,7 @@ command -pV true
command -pV /bin/ls
fun() {
+ :
}
command -pV fun
command -pV break
diff --git a/tools/regression/bin/sh/execution/func2.0 b/tools/regression/bin/sh/execution/func2.0
index affa802..9830b5e 100644
--- a/tools/regression/bin/sh/execution/func2.0
+++ b/tools/regression/bin/sh/execution/func2.0
@@ -1,4 +1,5 @@
# $FreeBSD$
+# The empty pairs of braces here are to test that this does not cause a crash.
f() { }
f
diff --git a/tools/regression/bin/sh/set-e/elif1.0 b/tools/regression/bin/sh/set-e/elif1.0
index 80c7af6..6a5937d 100644
--- a/tools/regression/bin/sh/set-e/elif1.0
+++ b/tools/regression/bin/sh/set-e/elif1.0
@@ -1,5 +1,7 @@
# $FreeBSD$
set -e
if false; then
+ :
elif false; then
+ :
fi
diff --git a/tools/regression/bin/sh/set-e/elif2.0 b/tools/regression/bin/sh/set-e/elif2.0
index 028938b..9dbb4bf 100644
--- a/tools/regression/bin/sh/set-e/elif2.0
+++ b/tools/regression/bin/sh/set-e/elif2.0
@@ -1,5 +1,7 @@
# $FreeBSD$
set -e
if false; then
+ :
elif false; false; then
+ :
fi
diff --git a/tools/regression/bin/sh/set-e/if1.0 b/tools/regression/bin/sh/set-e/if1.0
index 0be254b..36aa4bd 100644
--- a/tools/regression/bin/sh/set-e/if1.0
+++ b/tools/regression/bin/sh/set-e/if1.0
@@ -1,4 +1,5 @@
# $FreeBSD$
set -e
if false; then
+ :
fi
diff --git a/tools/regression/bin/sh/set-e/if3.0 b/tools/regression/bin/sh/set-e/if3.0
index b23d5ba..a4916a8 100644
--- a/tools/regression/bin/sh/set-e/if3.0
+++ b/tools/regression/bin/sh/set-e/if3.0
@@ -1,4 +1,5 @@
# $FreeBSD$
set -e
if false; false; then
+ :
fi
diff --git a/tools/regression/bin/sh/set-e/while1.0 b/tools/regression/bin/sh/set-e/while1.0
index e4c8938..371c94a 100644
--- a/tools/regression/bin/sh/set-e/while1.0
+++ b/tools/regression/bin/sh/set-e/while1.0
@@ -1,4 +1,5 @@
# $FreeBSD$
set -e
while false; do
+ :
done
diff --git a/tools/regression/bin/sh/set-e/while2.0 b/tools/regression/bin/sh/set-e/while2.0
index a331237..124966c 100644
--- a/tools/regression/bin/sh/set-e/while2.0
+++ b/tools/regression/bin/sh/set-e/while2.0
@@ -1,4 +1,5 @@
# $FreeBSD$
set -e
while false; false; do
+ :
done
OpenPOWER on IntegriCloud