natPosixProcess.cc (startProcess): Handle case where PATH or LD_LIBRARY_PATH is not set in parent environment.

* java/lang/natPosixProcess.cc (startProcess): Handle case where
	PATH or LD_LIBRARY_PATH is not set in parent environment.

From-SVN: r77203
This commit is contained in:
Tom Tromey 2004-02-04 00:07:19 +00:00 committed by Tom Tromey
parent 40e02b4a76
commit 2565abce54
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2004-02-03 Tom Tromey <tromey@redhat.com>
* java/lang/natPosixProcess.cc (startProcess): Handle case where
PATH or LD_LIBRARY_PATH is not set in parent environment.
2004-02-03 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkListPeer.java,

View file

@ -1,6 +1,6 @@
// natPosixProcess.cc - Native side of POSIX process code.
/* Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation
/* Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation
This file is part of libgcj.
@ -207,7 +207,7 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
char *path_val = getenv ("PATH");
char *ld_path_val = getenv ("LD_LIBRARY_PATH");
environ = env;
if (getenv ("PATH") == NULL)
if (path_val && getenv ("PATH") == NULL)
{
char *path_env = (char *) _Jv_Malloc (strlen (path_val)
+ 5 + 1);
@ -215,7 +215,7 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
strcat (path_env, path_val);
putenv (path_env);
}
if (getenv ("LD_LIBRARY_PATH") == NULL)
if (ld_path_val && getenv ("LD_LIBRARY_PATH") == NULL)
{
char *ld_path_env
= (char *) _Jv_Malloc (strlen (ld_path_val) + 16 + 1);