From: Mark Wielaard Date: Tue, 19 Apr 2005 09:29:16 +0000 (+0000) Subject: natRuntime.cc (insertSystemProperties): Set java.class.path to CLASSPATH only when... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8a5691f87d716bf662a68dc290925f1d52ab3435;p=gcc.git 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: r98394 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 37cb8d93e1d..5e9d81006de 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2005-04-19 Mark Wielaard + + * 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-19 Michael Koch * javax/swing/text/rtf/ControlWordToken.java, diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc index 9ffeef7ad62..affe27a5fad 100644 --- a/libjava/java/lang/natRuntime.cc +++ b/libjava/java/lang/natRuntime.cc @@ -598,13 +598,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 *