OSDN Git Service

2003-01-31 Julian Dolby <dolby@us.ibm.com>
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 31 Jan 2003 17:00:01 +0000 (17:00 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 31 Jan 2003 17:00:01 +0000 (17:00 +0000)
* java/util/Properties.java (load): Ignore backslash before EOF.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62186 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/util/Properties.java

index a746b4a..d7989f6 100644 (file)
@@ -1,3 +1,7 @@
+2003-01-31  Julian Dolby  <dolby@us.ibm.com>
+
+       * java/util/Properties.java (load): Ignore backslash before EOF.
+
 2003-01-30  Jeff Sturm  <jsturm@one-point.com>
 
        * java/lang/natClass.cc (initializeClass): Check tables when
index cb77661..907ec2c 100644 (file)
@@ -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 @@ label   = Name:\\u0020</pre>
                   {
                     // 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)))