diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1999-05-12 07:41:17 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1999-05-12 07:41:17 -0700 |
commit | 7f8e55a0b9ee9e49badd7bf1e825f9056ed4ba95 (patch) | |
tree | 6bdc6c27cf74c0c7436322381b9b9e990561387f | |
parent | c41dc2ffe92548120d42080e165ace9271f9150b (diff) | |
download | gcc-7f8e55a0b9ee9e49badd7bf1e825f9056ed4ba95.zip gcc-7f8e55a0b9ee9e49badd7bf1e825f9056ed4ba95.tar.gz gcc-7f8e55a0b9ee9e49badd7bf1e825f9056ed4ba95.tar.bz2 |
File.java (mkdirs): Handle a null parent directory.
h
* java/io/File.java (mkdirs): Handle a null parent directory.
From-SVN: r26903
-rw-r--r-- | libjava/java/io/File.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index 30d9887..fa098e2 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -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(); } |