From 99d804ceef2fff0aee5ed664804cf6fc1c592d33 Mon Sep 17 00:00:00 2001 From: dtucker Date: Mon, 19 Feb 2007 11:44:25 +0000 Subject: [PATCH] - (dtucker) [contrib/findssl.sh] Add "which" as a shell function since some platforms don't have it. Patch from dleonard at vintela.com. --- ChangeLog | 2 ++ contrib/findssl.sh | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index 54a958b4..a8637d61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,8 @@ authentication. This allows configurations such as permitting password authentication from the local net only while requiring pubkey from offsite. ok djm@, man page bits ok jmc@ + - (dtucker) [contrib/findssl.sh] Add "which" as a shell function since some + platforms don't have it. Patch from dleonard at vintela.com. 20070128 - (djm) [channels.c serverloop.c] Fix so-called "hang on exit" (bz #52) diff --git a/contrib/findssl.sh b/contrib/findssl.sh index a4e8f4c8..128db74c 100644 --- a/contrib/findssl.sh +++ b/contrib/findssl.sh @@ -89,6 +89,25 @@ LD_LIBRARY_PATH=${LD_LIBRARY_PATH:=$DEFAULT_LIBPATH} LIBRARY_PATH=${LIBRARY_PATH:=$DEFAULT_LIBPATH} export LIBPATH LD_LIBRARY_PATH LIBRARY_PATH +# not all platforms have a 'which' command +if which ls >/dev/null 2>/dev/null; then + : which is defined +else + which () { + saveIFS="$IFS" + IFS=: + for p in $PATH; do + if test -x "$p/$1" -a -f "$p/$1"; then + IFS="$saveIFS" + echo "$p/$1" + return 0 + fi + done + IFS="$saveIFS" + return 1 + } +fi + # # Search for OpenSSL headers and print versions # -- 2.45.2