This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: encode \0 in Java strings


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 */
 	{


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]