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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: gcjh -vs- PR 5365


I'm checking this in.

This fixes the part of PR 5365 that I could reproduce.

Tom

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

	Fix for PR java/5365:
	* gjavah.c (process_file): Turn class name into a file name.

Index: gjavah.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/gjavah.c,v
retrieving revision 1.80
diff -u -r1.80 gjavah.c
--- gjavah.c 2001/12/27 03:35:20 1.80
+++ gjavah.c 2002/01/16 00:18:41
@@ -1,7 +1,7 @@
 /* Program to write C++-suitable header files from a Java(TM) .class
    file.  This is similar to SUN's javah.
 
-Copyright (C) 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -1969,10 +1969,18 @@
 	{
 	  /* Strip off the ".class" portion of the name when printing
 	     the include file name.  */
-	  int len = strlen (jcf->classname);
+	  char *name;
+	  int i, len = strlen (jcf->classname);
 	  if (len > 6 && ! strcmp (&jcf->classname[len - 6], ".class"))
 	    len -= 6;
-	  print_include (out, jcf->classname, len);
+	  /* Turn the class name into a file name.  */
+	  name = xmalloc (len + 1);
+	  for (i = 0; i < len; ++i)
+	    name[i] = jcf->classname[i] == '.' ? '/' : jcf->classname[i];
+	  name[i] = '\0';
+	  print_include (out, name, len);
+	  free (name);
+
 	  if (! flag_jni)
 	    print_include (out, "gcj/cni", -1);
 	}


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