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: fix PR 27892


I'm checking this in on the trunk.

This fixes PR 27892.  Andreas Tobler tested it out on HP-UX and
Darwin.

Tom

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

	PR libgcj/27892:
	* gij.cc (main): Use putenv.

Index: gij.cc
===================================================================
--- gij.cc	(revision 114348)
+++ gij.cc	(working copy)
@@ -101,7 +101,12 @@
 
   if (! libpath || strcmp (libpath, newpath))
     {
-      setenv (LTDL_SHLIBPATH_VAR, newpath, 1);
+      char *buffer = (char *) JvMalloc (strlen (LTDL_SHLIBPATH_VAR)
+					+ strlen (newpath) + 2);
+      strcpy (buffer, LTDL_SHLIBPATH_VAR);
+      strcat (buffer, "=");
+      strcat (buffer, newpath);
+      putenv (buffer);
       JvFree (newpath);
 
       int error_code = execvp (argv[0], (char* const*) argv);


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