Skip to content

Commit af042aa

Browse files
committed
GP-2987: Fixing a few launch issues (NationalSecurityAgency#4872, Closes NationalSecurityAgency#4893)
1 parent ffbcbef commit af042aa

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Ghidra/RuntimeScripts/Linux/support/launch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ fi
145145
JAVA_CMD="${JAVA_HOME}/bin/java"
146146

147147
# Get the configurable VM arguments from the launch properties
148-
while IFS= read -r line; do
148+
while IFS=$'\r\n' read -r line; do
149149
VMARGS_FROM_LAUNCH_PROPS+=("$line")
150150
done < <(java -cp "${LS_CPATH}" LaunchSupport "${INSTALL_DIR}" -vmargs)
151151

Ghidra/RuntimeScripts/Windows/support/launch.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ if "%JAVA_HOME%" == "" (
129129
set "JAVA_CMD=%JAVA_HOME%\bin\java"
130130

131131
:: Get the configurable VM arguments from the launch properties
132-
for /f "delims=*" %%i in ('java -cp "%LS_CPATH%" LaunchSupport "%INSTALL_DIR%" -vmargs') do set VMARG_LIST=%VMARG_LIST% %%i
132+
for /f "delims=*" %%i in ('java -cp "%LS_CPATH%" LaunchSupport "%INSTALL_DIR%" -vmargs') do set VMARG_LIST=!VMARG_LIST! %%i
133133

134134
:: Set Max Heap Size if specified
135135
if not "%MAXMEM%"=="" (

GhidraBuild/LaunchSupport/src/main/java/LaunchSupport.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ private static int handleVmArgs(JavaConfig javaConfig) {
291291
return EXIT_FAILURE;
292292
}
293293

294-
javaConfig.getLaunchProperties().getVmArgList().forEach(arg -> System.out.println(arg));
294+
// Force newline style to make cross-platform parsing consistent
295+
javaConfig.getLaunchProperties().getVmArgList().forEach(e -> System.out.print(e + "\r\n"));
295296
return EXIT_SUCCESS;
296297
}
297298
}

0 commit comments

Comments
 (0)