mirror of
https://github.com/openjdk/jdk7u.git
synced 2025-12-10 10:13:47 -06:00
8282397: createTempFile method of java.io.File is failing when called with suffix of spaces character
Reviewed-by: bae Backport-of: d48181536fa9b99f01fc80f8adb73777ec6ffa58
This commit is contained in:
parent
780ea14119
commit
a4c19d9e66
@ -359,9 +359,12 @@ class Win32FileSystem extends FileSystem {
|
||||
// is a ":" at position 1 and the first character is not a letter
|
||||
String pathname = f.getPath();
|
||||
int lastColon = pathname.lastIndexOf(":");
|
||||
if (lastColon > 1 ||
|
||||
(lastColon == 1 && !isLetter(pathname.charAt(0))))
|
||||
return true;
|
||||
|
||||
// Valid if there is no ":" present or if the last ":" present is
|
||||
// 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
|
||||
Path path = null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user