From 371ac725580efe2c70111c2403a98b0fef3b11d6 Mon Sep 17 00:00:00 2001 From: Julian Dolby Date: Fri, 31 Jan 2003 17:00:01 +0000 Subject: [PATCH] Properties.java (load): Ignore backslash before EOF. 2003-01-31 Julian Dolby * java/util/Properties.java (load): Ignore backslash before EOF. From-SVN: r62186 --- libjava/ChangeLog | 4 ++++ libjava/java/util/Properties.java | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index a746b4aa860..d7989f67dbf 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2003-01-31 Julian Dolby + + * java/util/Properties.java (load): Ignore backslash before EOF. + 2003-01-30 Jeff Sturm * java/lang/natClass.cc (initializeClass): Check tables when diff --git a/libjava/java/util/Properties.java b/libjava/java/util/Properties.java index cb77661a397..907ec2c4d7a 100644 --- a/libjava/java/util/Properties.java +++ b/libjava/java/util/Properties.java @@ -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 { // 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))) -- 2.30.2