PATCH: encode \0 in Java strings

Tom Tromey tromey@cygnus.com
Wed Feb 10 15:05:00 GMT 1999


This patch changes the Java compiler to correctly handle \0 in a
string.  I'm committing it.

1999-02-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	
	* lex.c (yylex): Encode \0 as UTF8.

Tom

Index: lex.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/java/lex.c,v
retrieving revision 1.34.2.13
retrieving revision 1.34.2.14
diff -u -r1.34.2.13 -r1.34.2.14
--- lex.c	1999/02/10 03:35:48	1.34.2.13
+++ lex.c	1999/02/10 22:52:18	1.34.2.14
@@ -906,8 +906,7 @@
 	  if (c == '\\')
 	    c = java_parse_escape_sequence ();
 	  no_error &= (c != JAVA_CHAR_ERROR ? 1 : 0);
-	  if (c)
-	    java_unicode_2_utf8 (c);
+	  java_unicode_2_utf8 (c);
 	}
       if (c == '\n' || c == UEOF) /* ULT */
 	{


More information about the Gcc-patches mailing list