Skip to content
Permalink
Browse files
8258457: testlibrary_tests/ctw/JarDirTest.java fails with InvalidPath…
…Exception on windows

Reviewed-by: mdoerr
Backport-of: 40ef00c
  • Loading branch information
RealCLanger committed Nov 15, 2021
1 parent 63848c5 commit 9f7729a7cdea6ac708c874ff896e24b265c86d06
Showing 1 changed file with 5 additions and 3 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -95,9 +95,11 @@ protected void compile(String[] args) throws Exception {
String[] cmd = Arrays.copyOf(CTW_COMMAND, CTW_COMMAND.length + args.length - 1);
System.arraycopy(args, 1, cmd, CTW_COMMAND.length, args.length - 1);
if (Platform.isWindows()) {
// '*' has to be escaped on windows
// arguments with '*' has to be quoted on windows
for (int i = 0; i < cmd.length; ++i) {
cmd[i] = cmd[i].replace("*", "\"*\"");
if (cmd[i].charAt(0) != '"' && cmd[i].indexOf('*') >= 0) {
cmd[i] = '"' + cmd[i] + '"';
}
}
}
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, cmd);

1 comment on commit 9f7729a

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 9f7729a Nov 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.