aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2003-03-02 22:36:20 +0000
committerMark Wielaard <mark@gcc.gnu.org>2003-03-02 22:36:20 +0000
commitbd3f5371a452ee7d8e56f69c36258d8ed8061777 (patch)
tree1372fc0161a5eb09a3240f8f83b0500992cc4668 /libjava
parent3595b91fd2924cdb6d03d34902d00c7eab493745 (diff)
downloadgcc-bd3f5371a452ee7d8e56f69c36258d8ed8061777.zip
gcc-bd3f5371a452ee7d8e56f69c36258d8ed8061777.tar.gz
gcc-bd3f5371a452ee7d8e56f69c36258d8ed8061777.tar.bz2
Properties.java (load): Only skip line if the first character is a comment, whitespaces don't count.
* java/util/Properties.java (load): Only skip line if the first character is a comment, whitespaces don't count. From-SVN: r63700
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/java/util/Properties.java10
2 files changed, 12 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 4d7e207..d76dfe7 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-02 Mark Wielaard <mark@klomp.org>
+
+ * java/util/Properties.java (load): Only skip line if the first
+ character is a comment, whitespaces don't count.
+
2003-03-02 Michael Koch <konqueror@gmx.de>
* java/net/NetPermission.java:
diff --git a/libjava/java/util/Properties.java b/libjava/java/util/Properties.java
index 279cf1e..52ca144 100644
--- a/libjava/java/util/Properties.java
+++ b/libjava/java/util/Properties.java
@@ -188,13 +188,17 @@ label = Name:\\u0020</pre>
{
char c = 0;
int pos = 0;
+ // If empty line or begins with a comment character, skip this line.
+ if (line.length() == 0
+ || line.charAt(0) == '#' || line.charAt(0) == '!')
+ continue;
+
while (pos < line.length()
&& Character.isWhitespace(c = line.charAt(pos)))
pos++;
- // If line is empty or begins with a comment character,
- // skip this line.
- if (pos == line.length() || c == '#' || c == '!')
+ // If line is empty skip this line.
+ if (pos == line.length())
continue;
// The characters up to the next Whitespace, ':', or '='