summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2005-04-19 11:40:24 +0000
committerMark Wielaard <mark@gcc.gnu.org>2005-04-19 11:40:24 +0000
commita4b25fb4d90764d464d9b5bbd42d00adcff2a0ce (patch)
treeca90af6d28dfa9bf2a01dd5170fc2ca6494793ab
parent77de2a1b7c1f79b5177d259f707f5a387673fe9b (diff)
downloadgcc-a4b25fb4d90764d464d9b5bbd42d00adcff2a0ce.tar.gz
natRuntime.cc (insertSystemProperties): Set java.class.path to CLASSPATH only when not empty.
* java/lang/natRuntime.cc (insertSystemProperties): Set java.class.path to CLASSPATH only when not empty. Fall back to default path "." when java.class.path is empty. From-SVN: r98404
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/java/lang/natRuntime.cc11
2 files changed, 15 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index c6ae69d83d0..fd40ebdbc00 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-17 Mark Wielaard <mark@klomp.org>
+
+ * java/lang/natRuntime.cc (insertSystemProperties): Set
+ java.class.path to CLASSPATH only when not empty. Fall back to
+ default path "." when java.class.path is empty.
+
2005-04-16 Anthony Green <green@redhat.com>
* Makefile.am (gnu-xml.lo, javax-imageio.lo, javax-xml.lo,
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index 8e07351bab2..b9bc46f1b0a 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -620,13 +620,20 @@ java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops)
// CLASSPATH environment variable if given. See gij.cc main () and
// prims.cc _Jv_CreateJavaVM () for all the ways this could have
// been set much earlier.
+ // If CLASSPATH isn't set or if the path is empty fall back to "."
path = newprops->getProperty(JvNewStringLatin1("java.class.path"));
if (!path)
{
char *classpath = getenv("CLASSPATH");
- if (classpath)
- SET ("java.class.path", classpath);
+ if (classpath && classpath[0] != 0)
+ {
+ path = JvNewStringLatin1 (classpath);
+ newprops->put(JvNewStringLatin1 ("java.class.path"), path);
+ }
}
+
+ if (!path || path->length() == 0)
+ SET ("java.class.path", ".");
}
java::lang::Process *