8136570: Stop changing user environment variables related to /usr/dt
authormartin
Wed, 16 Sep 2015 10:49:11 -0700
changeset 32653 74f43cd059ec
parent 32652 aed323c3a01d
child 32654 23ae9cdf149e
child 32760 3851193a8c60
8136570: Stop changing user environment variables related to /usr/dt 4953367: MAWT: Java should be more careful manipulating NLSPATH, XFILESEARCHPATH env variables Summary: Stop changing user environment variables: NLSPATH XFILESEARCHPATH Reviewed-by: prr
jdk/src/java.base/unix/native/libjava/java_props_md.c
--- a/jdk/src/java.base/unix/native/libjava/java_props_md.c	Thu Sep 17 17:33:00 2015 +0200
+++ b/jdk/src/java.base/unix/native/libjava/java_props_md.c	Wed Sep 16 10:49:11 2015 -0700
@@ -91,46 +91,6 @@
     return 0;
 }
 
-/* This function sets an environment variable using envstring.
- * The format of envstring is "name=value".
- * If the name has already existed, it will append value to the name.
- */
-static void
-setPathEnvironment(char *envstring)
-{
-    char name[20], *value, *current;
-
-    value = strchr(envstring, '='); /* locate name and value separator */
-
-    if (! value)
-        return; /* not a valid environment setting */
-
-    /* copy first part as environment name */
-    strncpy(name, envstring, value - envstring);
-    name[value-envstring] = '\0';
-
-    value++; /* set value point to value of the envstring */
-
-    current = getenv(name);
-    if (current) {
-        if (! strstr(current, value)) {
-            /* value is not found in current environment, append it */
-            char *temp = malloc(strlen(envstring) + strlen(current) + 2);
-        strcpy(temp, name);
-        strcat(temp, "=");
-        strcat(temp, current);
-        strcat(temp, ":");
-        strcat(temp, value);
-        putenv(temp);
-        }
-        /* else the value has already been set, do nothing */
-    }
-    else {
-        /* environment variable is not found */
-        putenv(envstring);
-    }
-}
-
 #ifndef P_tmpdir
 #define P_tmpdir "/var/tmp"
 #endif
@@ -628,16 +588,6 @@
     sprops.path_separator = ":";
     sprops.line_separator = "\n";
 
-#if !defined(_ALLBSD_SOURCE)
-    /* Append CDE message and resource search path to NLSPATH and
-     * XFILESEARCHPATH, in order to pick localized message for
-     * FileSelectionDialog window (Bug 4173641).
-     */
-    setPathEnvironment("NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat");
-    setPathEnvironment("XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt");
-#endif
-
-
 #ifdef MACOSX
     setProxyProperties(&sprops);
 #endif