a patch to java.util.Properties.java

Archie Cobbs kaffe@rufus.w3.org
Thu, 12 Apr 2001 17:34:59 -0700 (PDT)


Ito Kazumitsu writes:
> 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;

Thanks, should be fixed now.

-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com