This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: fix for PR 7950
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: 17 Sep 2002 14:56:47 -0600
- Subject: Patch: FYI: fix for PR 7950
- Reply-to: tromey at redhat dot com
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';