summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/test/bctest
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/test/bctest')
-rwxr-xr-xcrypto/openssl/test/bctest23
1 files changed, 19 insertions, 4 deletions
diff --git a/crypto/openssl/test/bctest b/crypto/openssl/test/bctest
index 17b75d4..bdb3218 100755
--- a/crypto/openssl/test/bctest
+++ b/crypto/openssl/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
OpenPOWER on IntegriCloud