From 1eae114065aa10a1011df5dbedcfc197ff60e6be Mon Sep 17 00:00:00 2001
From: Steve Holme <steve_holme@hotmail.com>
Date: Sat, 5 Mar 2016 21:04:43 +0000
Subject: [PATCH] build-openssl.bat: Fixed cannot find perl if installed but
 not in path

---
 projects/build-openssl.bat | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/projects/build-openssl.bat b/projects/build-openssl.bat
index 205b0c321..9081b46b2 100644
--- a/projects/build-openssl.bat
+++ b/projects/build-openssl.bat
@@ -6,7 +6,7 @@ rem *                             / __| | | | |_) | |
 rem *                            | (__| |_| |  _ <| |___
 rem *                             \___|\___/|_| \_\_____|
 rem *
-rem * Copyright (C) 2012 - 2015, Steve Holme, <steve_holme@hotmail.com>.
+rem * Copyright (C) 2012 - 2016, Steve Holme, <steve_holme@hotmail.com>.
 rem *
 rem * This software is licensed as described in the file COPYING, which
 rem * you should have received as part of this distribution. The terms
@@ -120,11 +120,18 @@ rem ***************************************************************************
   rem Check we have Visual Studio installed
   if not exist "%PF%\%VC_PATH%" goto novc
 
-  rem Check we have Perl installed
+  rem Check we have Perl in our path
   echo %PATH% | findstr /I /C:"\Perl" 1>nul
   if errorlevel 1 (
-    if not exist "%SystemDrive%\Perl" (
-      if not exist "%SystemDrive%\Perl64" goto noperl
+    rem It isn't so check we have it installed and set the path if it is
+    if exist "%SystemDrive%\Perl" (
+      set "PATH=%PATH%;%SystemDrive%\Perl\bin"
+    ) else (
+      if exist "%SystemDrive%\Perl64" (
+        set "PATH=%SystemDrive%\Perl64\bin;%PATH%"
+      ) else (
+        goto noperl
+      )
     )
   )
 
-- 
2.50.1