From 32f584cb1c5a378f77e086783391bfb50952a916 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Mon, 28 Feb 2011 21:21:38 -0800 Subject: [PATCH] shelltest: detect the ". of empty script" shell problem. --- t/nothing.od | 2 ++ t/shelltest.od | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 t/nothing.od diff --git a/t/nothing.od b/t/nothing.od new file mode 100644 index 0000000..6661249 --- /dev/null +++ b/t/nothing.od @@ -0,0 +1,2 @@ +# this shell script contains no commands. +# it's used for testing the return value of '. ./nothing.od' in shelltest.od. diff --git a/t/shelltest.od b/t/shelltest.od index 9e3ded3..c97fa62 100644 --- a/t/shelltest.od +++ b/t/shelltest.od @@ -280,5 +280,13 @@ lt [ "$x" = "1" ] || fail 112 [ "$y$z" = "67" ] || fail 113 +# reported by Tim Allen: +# some shells don't return 0 from an empty '.' script; they return the +# previous command's exit code instead. +# See: +# http://pubs.opengroup.org/onlinepubs/009695399/utilities/dot.html +# http://austingroupbugs.net/view.php?id=114 +false +. ./nothing.od || warn 114 exit $FAIL