File.java (mkdirs): Handle a null parent directory.

h
	* java/io/File.java (mkdirs):  Handle a null parent directory.

From-SVN: r26903
This commit is contained in:
Per Bothner 1999-05-12 07:41:17 -07:00
parent c41dc2ffe9
commit 7f8e55a0b9

View File

@ -190,10 +190,14 @@ public class File implements Serializable
if (x.isDirectory())
return true;
String p = x.getPath();
x.setPath(x.getParent());
if (! mkdirs (x))
return false;
x.setPath(p);
String parent = x.getParent();
if (parent != null)
{
x.setPath(parent);
if (! mkdirs (x))
return false;
x.setPath(p);
}
return x.mkdir();
}