]> andersk Git - openssh.git/commitdiff
- (dtucker) [contrib/findssl.sh] Add "which" as a shell function since some
authordtucker <dtucker>
Mon, 19 Feb 2007 11:44:25 +0000 (11:44 +0000)
committerdtucker <dtucker>
Mon, 19 Feb 2007 11:44:25 +0000 (11:44 +0000)
   platforms don't have it.  Patch from dleonard at vintela.com.

ChangeLog
contrib/findssl.sh

index 54a958b4f6cf4bd84096353b7c4ad715054dbbe2..a8637d6100faee18778b4ffcdc87d7e4b264b4ad 100644 (file)
--- 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)
index a4e8f4c83f6584f96eb0ddf62e7c5dccef985d60..128db74c1064b4d46d82df05e72249b7223d0e80 100644 (file)
@@ -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
 #
This page took 0.103344 seconds and 5 git commands to generate.