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
--- 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