GP-1735: Fixed analyzeHeadless.bat maximum setlocal recursion level

being reached when too many command line arguments were specified
This commit is contained in:
Ryan Kurtz
2022-02-10 06:28:54 -05:00
parent 4636795205
commit 44a428d6d4
@@ -28,6 +28,7 @@ set "SCRIPT_DIR=%~dp0"
:: Loop through parameters (if there aren't any, just continue) and store
:: in params variable.
setlocal EnableDelayedExpansion
set params=
:Loop
@@ -35,7 +36,6 @@ if "%~1" == "" goto cont
:: If -import is found and Windows has not done proper wildcard expansion, force
:: this to happen and save expansion to params variable.
setlocal EnableDelayedExpansion
if "%~1" == "-import" (
set params=!params! -import
for %%f in ("%~2") DO (
@@ -45,11 +45,12 @@ if "%~1" == "-import" (
) else (
set params=!params! "%~1"
)
setlocal DisableDelayedExpansion
shift
goto Loop
:cont
setlocal DisableDelayedExpansion
call "%SCRIPT_DIR%launch.bat" %LAUNCH_MODE% Ghidra-Headless "%MAXMEM%" "%VMARG_LIST%" ghidra.app.util.headless.AnalyzeHeadless %params%