Skip to content

Commit

Permalink
buildconf.bat: Move DOS variable clean-up code to separate function
Browse files Browse the repository at this point in the history
Rather than duplicate future variables, during clean-up of both success
and error conditions, use a common function that can be called by both.
  • Loading branch information
captain-caveman2k committed Aug 9, 2015
1 parent 4d13b78 commit ecece2c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions buildconf.bat
Expand Up @@ -79,14 +79,14 @@ rem snapshot archives.
goto success

rem Main generate function.
rem
rem Returns:
rem
rem 0 - success
rem 1 - failure to generate Makefile
rem 2 - failure to generate tool_hugehelp.c
rem 3 - failure to generate curlbuild.h
rem
rem
:generate
rem create Makefile
if exist Makefile.dist (
Expand Down Expand Up @@ -162,6 +162,14 @@ rem

exit /B 0

rem Function to clean-up local variables under DOS, Windows 3.x and
rem Windows 9x as setlocal isn't available until Windows NT
rem
:dosCleanup
set MODE=

exit /B

:syntax
rem Display the help
echo.
Expand Down Expand Up @@ -214,14 +222,14 @@ rem
if "%OS%" == "Windows_NT" (
endlocal
) else (
set MODE=
call :dosCleanup
)
exit /B 1

:success
if "%OS%" == "Windows_NT" (
endlocal
) else (
set MODE=
call :dosCleanup
)
exit /B 0

0 comments on commit ecece2c

Please sign in to comment.