Patch: FYI: fix for PR 7950

Tom Tromey tromey@redhat.com
Tue Sep 17 13:58:00 GMT 2002


I'm checking this in.

This fixes PR 7950.  The problem was that a \r at the end of a file
caused UEOF to be pushed back.  This is incorrect; the patch treats \r
at EOF as a \n (as required).

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* lex.c (java_read_unicode_collapsing_terminators): Handle case
	where \r appears at EOF.  Fixes PR java/7950.

Index: lex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lex.c,v
retrieving revision 1.89
diff -u -r1.89 lex.c
--- lex.c 23 Jul 2002 03:20:27 -0000 1.89
+++ lex.c 17 Sep 2002 18:23:05 -0000
@@ -599,7 +599,7 @@
 	 return a single line terminator.  */
       int dummy;
       c = java_read_unicode (lex, &dummy);
-      if (c != '\n')
+      if (c != '\n' && c != UEOF)
 	lex->unget_value = c;
       /* In either case we must return a newline.  */
       c = '\n';



More information about the Java-patches mailing list