summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2006-11-25 22:34:45 +0000
committerMark Wielaard <mark@klomp.org>2006-11-25 22:34:45 +0000
commit1b8b29e05dae6be1c7bb43e9610c4991c7307dc7 (patch)
tree3eb9c2066fefec4d479345c33d8080cee0b58846
parent6767daef55e6b33a5428eb792dcf98c39ef7e115 (diff)
downloadclasspath-1b8b29e05dae6be1c7bb43e9610c4991c7307dc7.tar.gz
* java/io/File.java (list): Return empty list for unreadable dirs.
-rw-r--r--ChangeLog4
-rw-r--r--java/io/File.java3
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 23464a7d2..157f55bc5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2006-11-25 Mark Wielaard <mark@klomp.org>
+ * java/io/File.java (list): Return empty list for unreadable dirs.
+
+2006-11-25 Mark Wielaard <mark@klomp.org>
+
* gnu/java/awt/peer/gtk/CairoGraphics2D.java (drawGlyphVector):
Synchronize on font peer.
(setFont): Likewise.
diff --git a/java/io/File.java b/java/io/File.java
index 1e0d22b47..49a0c818c 100644
--- a/java/io/File.java
+++ b/java/io/File.java
@@ -754,8 +754,9 @@ public class File implements Serializable, Comparable
String files[] = VMFile.list(path);
// Check if an error occured in listInternal().
+ // This is an unreadable directory, pretend there is nothing inside.
if (files == null)
- return null;
+ return new String[0];
if (filter == null)
return files;