diff options
author | Adam King <aking@dreammechanics.com> | 2002-04-17 23:02:33 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2002-04-18 00:02:33 +0100 |
commit | b7403f10f2892ac2f2f4f09f9635d41043f728d9 (patch) | |
tree | a46b09c7c072767f0e4e9badcd7d7074f40828e5 /libjava/java/io | |
parent | 63501e9115d6fc0183adc9ed97efdf83ee47c724 (diff) | |
download | gcc-b7403f10f2892ac2f2f4f09f9635d41043f728d9.zip gcc-b7403f10f2892ac2f2f4f09f9635d41043f728d9.tar.gz gcc-b7403f10f2892ac2f2f4f09f9635d41043f728d9.tar.bz2 |
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
Diffstat (limited to 'libjava/java/io')
-rw-r--r-- | libjava/java/io/File.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index a268278..2086f10 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -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(); |