Patch: FYI: gcj resource compilation from jar

Tom Tromey tromey@redhat.com
Fri Jan 24 02:36:00 GMT 2003


This fixes a buglet in the new compile-resource-from-jar feature.
gcj inserted a spurious \0 into the resource data.

I'm applying this as obvious.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* jcf-parse.c (parse_zip_file_entries): Overwrite trailing \0 of
	file name in resource buffer.

Index: jcf-parse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-parse.c,v
retrieving revision 1.134
diff -u -r1.134 jcf-parse.c
--- jcf-parse.c 23 Jan 2003 00:40:40 -0000 1.134
+++ jcf-parse.c 24 Jan 2003 01:56:58 -0000
@@ -1221,7 +1221,9 @@
 	    buffer = ALLOC (zdir->filename_length + 1 +
 			    (jcf->buffer_end - jcf->buffer));
 	    strcpy (buffer, file_name);
-	    memcpy (buffer + zdir->filename_length + 1,
+	    /* This is not a typo: we overwrite the trailing \0 of the
+	       file name; this is just how the data is laid out.  */
+	    memcpy (buffer + zdir->filename_length,
 		    jcf->buffer, jcf->buffer_end - jcf->buffer);
 
 	    compile_resource_data (file_name, buffer,



More information about the Gcc-patches mailing list