Properties.java (load): Only skip line if the first character is a comment, whitespac...
authorMark Wielaard <mark@klomp.org>
Sun, 2 Mar 2003 22:36:20 +0000 (22:36 +0000)
committerMark Wielaard <mark@gcc.gnu.org>
Sun, 2 Mar 2003 22:36:20 +0000 (22:36 +0000)
       * java/util/Properties.java (load): Only skip line if the first
       character is a comment, whitespaces don't count.

From-SVN: r63700

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

index 4d7e2070efb02a028f6bfdccc9b5ca753d5336ac..d76dfe7bf69e8d3a76b16e26105852ac2d2d8c42 100644 (file)
@@ -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:
index 279cf1e7b82ac5b0b756b8cdad4141cc96c509ac..52ca144cb7002aff7eb3b30da32694665d8ba4de 100644 (file)
@@ -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 '='