From 4a21346ef3b17f86c1878ea9df41268ae3c9ec3d Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sat, 8 Aug 2015 11:09:08 +0100 Subject: scripts: Always perform setlocal and endlocal calls in pairs Ensure that there isn't a mismatch between setlocal and endlocal calls, which could have happened due to setlocal being called after certain error conditions were checked for. --- projects/generate.bat | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'projects/generate.bat') diff --git a/projects/generate.bat b/projects/generate.bat index 36778e810..01e62a53c 100644 --- a/projects/generate.bat +++ b/projects/generate.bat @@ -32,6 +32,11 @@ rem If you need to set the errorlevel do this instead: CALL :seterr [#] rem Check we are running on a Windows NT derived OS if not "%OS%" == "Windows_NT" goto nodos + rem Set our variables + setlocal ENABLEEXTENSIONS + set VERSION=ALL + set MODE=GENERATE + rem Check we are not running on a network drive if "%~d0."=="\\." goto nonetdrv @@ -41,11 +46,6 @@ rem If you need to set the errorlevel do this instead: CALL :seterr [#] rem Check we are running from a curl git repository if not exist ..\GIT-INFO goto norepo - rem Set our variables - setlocal ENABLEEXTENSIONS - set VERSION=ALL - set MODE=GENERATE - rem Detect programs. HAVE_ rem When not found the variable is set undefined. The undefined pattern rem allows for statements like "if not defined HAVE_PERL (command)" @@ -515,7 +515,7 @@ rem Returns exit code 0 on success or 1 on failure. exit /b %EXITCODE% :error - endlocal + if "%OS%" == "Windows_NT" endlocal exit /B 1 :success -- cgit v1.2.3