Dalibor Topic wrote:
The problem is illustrated by this example from kaffe's
regression test suite:
import java.io.File;
public class FileTest {
public static void exists(File f) {
String type = "File";
if (f.isDirectory()) { type = "Directory"; }
System.out.print(type + " \"" + f.getPath() );
if (f.exists()) {
System.out.println("\" does exist");
} else {
System.out.println("\" does not exist");
}
}
public static void main(String[] argv) throws Exception {
File g5 = new File("","NotExist2"); exists(g5);
}
}
it should print File "/NotExist2" does not exist on Unix and
File "\NotExist2" does not exist on Windows.
Thanks!
I made an additional change to your patch to prevent to accidental
forming of a UNC path prefix (\\) by trimming the leading separators
from name. It's attached.