>>>>> "Tom" == Tom Tromey <[EMAIL PROTECTED]> writes:

Roman> Look out for a line with 'BUG' in the scanner
Roman> output.

Tom> Oh, duh, there it is.  Sorry :(

Ok, this patch fixes the bug for me.  I'm checking it in.

I see a few other instances of this problem in the code.  In general
this lookahead scheme is a bit flawed, since the code often pushes
back a 'char' ... but for proper EOF handling it should push back the
raw int.  Another solution here would be to check read() results more
uniformly.

So much for my earlier theory :)

Tom

2006-08-18  Tom Tromey  <[EMAIL PROTECTED]>

        * gnu/javax/swing/text/html/css/CSSScanner.java (readWhitespace): Push
        the 'int', not the cast char.

Index: gnu/javax/swing/text/html/css/CSSScanner.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/javax/swing/text/html/css/CSSScanner.java,v
retrieving revision 1.1
diff -u -r1.1 CSSScanner.java
--- gnu/javax/swing/text/html/css/CSSScanner.java       16 Aug 2006 21:31:27 
-0000      1.1
+++ gnu/javax/swing/text/html/css/CSSScanner.java       18 Aug 2006 20:10:22 
-0000
@@ -602,7 +602,7 @@
         chc = (char) ch;
       }
     // Push back last character read.
-    lookahead[0] = chc;
+    lookahead[0] = ch;
     
   }
 

Reply via email to