a patch to java.util.Properties.java

Ito Kazumitsu kaffe@rufus.w3.org
Mon, 9 Apr 2001 15:58:24 +0900


This is a patch to java.util.Properties.java, without which
load(InputStream) goes into an infinite loop if end of file
appears before '\n'.

--- Properties.java.orig	Sat Jul 22 07:53:23 2000
+++ Properties.java	Mon Apr  9 15:46:39 2001
@@ -162,7 +162,11 @@
 		switch (ch) {
 			case '#':
 			case '!':
-				while ((ch = in.read()) != '\n');
+				while (true) {
+					ch = in.read();
+					if (ch == -1) return false;
+					if (ch == '\n') break;
+				}
 				continue;
 			case -1:
 				return false;