Skip to content

Commit

Permalink
8339180: Enhanced Building of Processes: Follow-on Issue
Browse files Browse the repository at this point in the history
Reviewed-by: yan, andrew
Backport-of: a71624a69ec5cc8600f2a3a53c23c75b43068830
  • Loading branch information
martinuy authored and gnu-andrew committed Jan 11, 2025
1 parent f53cbea commit e8db40e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/java.base/windows/classes/java/lang/ProcessImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ private static String[] getTokensFromCommand(String command) {
// We guarantee the only command file execution for implicit [cmd.exe] run.
// http://technet.microsoft.com/en-us/library/bb490954.aspx
// All space characters require quoting are checked in needsEscaping().
"\t\"<>&|^",
"\t\"<>",
"\t\"<>",
"\t"
"\"<>&|^",
"\"<>",
"\"<>",
""
};

private static String createCommandLine(int verificationType,
Expand Down Expand Up @@ -339,6 +339,7 @@ private static boolean needsEscaping(int verificationType, String arg) {
continue; // skip over common characters
// All space chars require quotes and other mode specific characters
if (Character.isSpaceChar(ch) ||
Character.isWhitespace(ch) ||
ESCAPE_VERIFICATION[verificationType].indexOf(ch) >= 0) {
return true;
}
Expand Down

0 comments on commit e8db40e

Please sign in to comment.