Patch: FYI: Properties fixlet
Tom Tromey
tromey@redhat.com
Fri Jan 31 16:56:00 GMT 2003
This came across the Classpath list recently.
I'm checking it in to the trunk and the 3.3 branch.
Tom
Index: ChangeLog
from Julian Dolby <dolby@us.ibm.com>
* java/util/Properties.java (load): Ignore backslash before EOF.
Index: java/util/Properties.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/Properties.java,v
retrieving revision 1.20
diff -u -r1.20 Properties.java
--- java/util/Properties.java 24 Dec 2002 23:37:45 -0000 1.20
+++ java/util/Properties.java 31 Jan 2003 06:09:15 -0000
@@ -1,5 +1,5 @@
/* Properties.java -- a set of persistent properties
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -271,6 +271,13 @@
{
// The line continues on the next line.
line = reader.readLine();
+
+ // We might have seen a backslash at the end of
+ // the file. The JDK ignores the backslash in
+ // this case, so we follow for compatibility.
+ if (line == null)
+ break;
+
pos = 0;
while (pos < line.length()
&& Character.isWhitespace(c = line.charAt(pos)))
More information about the Java-patches
mailing list