File.java (normalizePath): Add Win32 support for auto conversion of a '/' path separator to Win32's '\'...
* java/io/File.java (normalizePath): Add Win32 support for auto conversion of a '/' path separator to Win32's '\' separator. From-SVN: r52447
This commit is contained in:
parent
63501e9115
commit
b7403f10f2
2 changed files with 10 additions and 0 deletions
|
@ -82,6 +82,11 @@ public class File implements Serializable, Comparable
|
|||
// Remove duplicate and redundant separator characters.
|
||||
private String normalizePath(String p)
|
||||
{
|
||||
// On Windows, convert any '/' to '\'. This appears to be the same logic
|
||||
// that Sun's Win32 Java performs.
|
||||
if (separatorChar == '\\')
|
||||
p = p.replace ('/', '\\');
|
||||
|
||||
int dupIndex = p.indexOf(dupSeparator);
|
||||
int plen = p.length();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue