mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8282397: createTempFile method of java.io.File is failing when called with suffix of spaces character
Reviewed-by: alanb
This commit is contained in:
parent
8d456ac0ec
commit
98d54e8eb2
1 changed files with 6 additions and 3 deletions
|
@ -333,9 +333,12 @@ class WinNTFileSystem extends FileSystem {
|
||||||
// is a ":" at position 1 and the first character is not a letter
|
// is a ":" at position 1 and the first character is not a letter
|
||||||
String pathname = f.getPath();
|
String pathname = f.getPath();
|
||||||
int lastColon = pathname.lastIndexOf(":");
|
int lastColon = pathname.lastIndexOf(":");
|
||||||
if (lastColon > 1 ||
|
|
||||||
(lastColon == 1 && !isLetter(pathname.charAt(0))))
|
// Valid if there is no ":" present or if the last ":" present is
|
||||||
return true;
|
// at index 1 and the first character is a latter
|
||||||
|
if (lastColon < 0 ||
|
||||||
|
(lastColon == 1 && isLetter(pathname.charAt(0))))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Invalid if path creation fails
|
// Invalid if path creation fails
|
||||||
Path path = null;
|
Path path = null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue