Author: toad
Date: 2007-12-08 23:48:59 +0000 (Sat, 08 Dec 2007)
New Revision: 16439
Modified:
trunk/freenet/src/freenet/config/FilePersistentConfig.java
Log:
Don't read zero length files
Modified: trunk/freenet/src/freenet/config/FilePersistentConfig.java
===================================================================
--- trunk/freenet/src/freenet/config/FilePersistentConfig.java 2007-12-08
21:41:25 UTC (rev 16438)
+++ trunk/freenet/src/freenet/config/FilePersistentConfig.java 2007-12-08
23:48:59 UTC (rev 16439)
@@ -50,7 +50,7 @@
System.err.println("Warning: Cannot write to config
tempfile: "+tempFilename);
}
if(filenameExists) {
- if(filename.canRead()) {
+ if(filename.canRead() && filename.length() > 0) {
try {
return initialLoad(filename);
} catch (FileNotFoundException e) {
@@ -66,7 +66,7 @@
}
}
if(tempFilename.exists()) {
- if(tempFilename.canRead()) {
+ if(tempFilename.canRead() && tempFilename.length() > 0)
{
try {
return initialLoad(tempFilename);
} catch (FileNotFoundException e) {