diff options
author | Jeroen Frijters <jeroen@sumatra.nl> | 2004-03-27 14:14:56 +0000 |
---|---|---|
committer | Jeroen Frijters <jeroen@sumatra.nl> | 2004-03-27 14:14:56 +0000 |
commit | 9353c6d8194f5443cf75ee0c4fef7330d51e9de1 (patch) | |
tree | 1afd765eef13a843c4f075ef08d95de6ef1050d2 /java/util/Properties.java | |
parent | d74c84934c0100e68798b9dacafd77b5bd47814c (diff) | |
download | classpath-9353c6d8194f5443cf75ee0c4fef7330d51e9de1.tar.gz |
2004-03-19 Ito Kazumitsu <kaz@maczuka.gcd.org>
* libraries/javalib/java/util/Properties (load): Delete leading whitespaces before checking comment characters.
Diffstat (limited to 'java/util/Properties.java')
-rw-r--r-- | java/util/Properties.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/java/util/Properties.java b/java/util/Properties.java index 2f4428958..921d55c21 100644 --- a/java/util/Properties.java +++ b/java/util/Properties.java @@ -188,17 +188,14 @@ 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; - + // Leading whitespaces must be deleted first. while (pos < line.length() && Character.isWhitespace(c = line.charAt(pos))) pos++; - // If line is empty skip this line. - if (pos == line.length()) + // If empty line or begins with a comment character, skip this line. + if ((line.length() - pos) == 0 + || line.charAt(pos) == '#' || line.charAt(pos) == '!') continue; // The characters up to the next Whitespace, ':', or '=' |