mirror of
https://github.com/moparisthebest/curl
synced 2024-11-10 11:35:07 -05:00
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.
This commit is contained in:
parent
4aee1f9cf5
commit
4a21346ef3
@ -30,16 +30,16 @@ rem This file is not included or required for curl's release archives or daily
|
|||||||
rem snapshot archives.
|
rem snapshot archives.
|
||||||
|
|
||||||
:begin
|
:begin
|
||||||
|
rem Set our variables
|
||||||
|
setlocal
|
||||||
|
set MODE=GENERATE
|
||||||
|
|
||||||
rem Switch to this batch file's directory
|
rem Switch to this batch file's directory
|
||||||
cd /d "%~0\.." 1>NUL 2>&1
|
cd /d "%~0\.." 1>NUL 2>&1
|
||||||
|
|
||||||
rem Check we are running from a curl git repository
|
rem Check we are running from a curl git repository
|
||||||
if not exist GIT-INFO goto norepo
|
if not exist GIT-INFO goto norepo
|
||||||
|
|
||||||
rem Set our variables
|
|
||||||
setlocal
|
|
||||||
set MODE=GENERATE
|
|
||||||
|
|
||||||
:parseArgs
|
:parseArgs
|
||||||
if "%~1" == "" goto start
|
if "%~1" == "" goto start
|
||||||
|
|
||||||
|
@ -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
|
rem Check we are running on a Windows NT derived OS
|
||||||
if not "%OS%" == "Windows_NT" goto nodos
|
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
|
rem Check we are not running on a network drive
|
||||||
if "%~d0."=="\\." goto nonetdrv
|
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
|
rem Check we are running from a curl git repository
|
||||||
if not exist ..\GIT-INFO goto norepo
|
if not exist ..\GIT-INFO goto norepo
|
||||||
|
|
||||||
rem Set our variables
|
|
||||||
setlocal ENABLEEXTENSIONS
|
|
||||||
set VERSION=ALL
|
|
||||||
set MODE=GENERATE
|
|
||||||
|
|
||||||
rem Detect programs. HAVE_<PROGNAME>
|
rem Detect programs. HAVE_<PROGNAME>
|
||||||
rem When not found the variable is set undefined. The undefined pattern
|
rem When not found the variable is set undefined. The undefined pattern
|
||||||
rem allows for statements like "if not defined HAVE_PERL (command)"
|
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%
|
exit /b %EXITCODE%
|
||||||
|
|
||||||
:error
|
:error
|
||||||
endlocal
|
if "%OS%" == "Windows_NT" endlocal
|
||||||
exit /B 1
|
exit /B 1
|
||||||
|
|
||||||
:success
|
:success
|
||||||
|
Loading…
Reference in New Issue
Block a user