X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=test%2Fbctest;h=bdb3218f7acaa2cac934c96c62a402ba5677636c;hp=17b75d4ecabdbb547ead3376992f7651d091d929;hb=0e8e6f19b2919e14c5bb7b645a359b96ad9fc13d;hpb=6186ef9338414ca722971208bd84645999df3546 diff --git a/test/bctest b/test/bctest index 17b75d4eca..bdb3218f7a 100755 --- a/test/bctest +++ b/test/bctest @@ -12,10 +12,22 @@ IFS=: -for dir in $PATH; do - bc="$dir/bc" +try_without_dir=true +# First we try "bc", then "$dir/bc" for each item in $PATH. +for dir in dummy:$PATH; do + if [ "$try_without_dir" = true ]; then + # first iteration + bc=bc + try_without_dir=false + else + # second and later iterations + bc="$dir/bc" + if [ ! -f "$bc" ]; then # '-x' is not available on Ultrix + bc='' + fi + fi - if [ -x "$bc" -a ! -d "$bc" ]; then + if [ ! "$bc" = '' ]; then failure=none @@ -92,5 +104,8 @@ EOF done echo "No working bc found. Consider installing GNU bc." >&2 -echo "cat >/dev/null" +if [ "$1" = ignore ]; then + echo "cat >/dev/null" + exit 0 +fi exit 1