From 91da35dbf2e8ef070bfe07125a71dc522610dcdd Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Sun, 27 Feb 2000 10:43:47 +0000 Subject: [PATCH] File.java (File(String, String)): For dirPath, treat an empty String the same as `null'. 2000-02-27 Bryce McKinlay * java/io/File.java (File(String, String)): For dirPath, treat an empty String the same as `null'. From-SVN: r32217 --- libjava/ChangeLog | 5 +++++ libjava/java/io/File.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index ccf334665d1..70dcc678be9 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2000-02-27 Bryce McKinlay + + * java/io/File.java (File(String, String)): For dirPath, treat an + empty String the same as `null'. + 2000-02-26 Anthony Green * gnu/gcj/io/MimeTypes.java: Test for null. diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index 184c5e0a7f9..c4a4e39a19d 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -79,7 +79,7 @@ public class File implements Serializable { if (name == null) throw new NullPointerException (); - if (dirPath != null) + if (dirPath != null && dirPath.length() > 0) { // Try to be smart about the number of separator characters. if (dirPath.charAt(dirPath.length() - 1) == separatorChar) -- 2.30.2