From dbdce6a73b0458db3f9dec0f4a3de3100aff5566 Mon Sep 17 00:00:00 2001 From: Peter Avalos Date: Sun, 25 Dec 2011 09:43:46 -0800 Subject: [PATCH] sh: Test that . /dev/null returns exit status 0 and does not preserve $?. Preserving $? may cause problems particularly if set -e is in effect. It may be useful to preserve the old value of $? in the dot script but this must not be implemented in such a way that it would break this test. Obtained-from: FreeBSD 219390 --- tools/regression/bin/sh/builtins/dot3.0 | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) create mode 100644 tools/regression/bin/sh/builtins/dot3.0 diff --git a/tools/regression/bin/sh/builtins/dot3.0 b/tools/regression/bin/sh/builtins/dot3.0 new file mode 100644 index 0000000..7fd2175 --- /dev/null +++ b/tools/regression/bin/sh/builtins/dot3.0 @@ -0,0 +1,10 @@ +# $FreeBSD: src/tools/regression/bin/sh/builtins/dot3.0,v 1.1 2011/03/07 23:52:23 jilles Exp $ + +# . should return 0 if no command was executed. + +if false; then + exit 3 +else + . /dev/null + exit $? +fi -- 1.7.7.2