Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-12-08 14:21:14 +0300
committerCorinna Vinschen <corinna@vinschen.de>2014-12-08 14:21:14 +0300
commite20a68a56fac257280845c16d72bc6430d9f692a (patch)
tree9ad6a81d93072207ffe808dc2d307bca5d51c6b8
parentca1cabfe215dabbfd8c088450530de1edfd1fbd3 (diff)
* environ.cc (regopt): Remove function.
(environ_init): Drop undocumented feature to read application-specific environment variables from the registry. * include/cygwin/version.h (CYGWIN_INFO_PROGRAM_OPTIONS_NAME): Remove.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/environ.cc45
-rw-r--r--winsup/cygwin/include/cygwin/version.h1
3 files changed, 9 insertions, 44 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 665e6e860..dfbbba5a6 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2014-12-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * environ.cc (regopt): Remove function.
+ (environ_init): Drop undocumented feature to read application-specific
+ environment variables from the registry.
+ * include/cygwin/version.h (CYGWIN_INFO_PROGRAM_OPTIONS_NAME): Remove.
+
2014-12-05 Corinna Vinschen <corinna@vinschen.de>
* environ.cc (build_env): Remove loquacious debug statements.
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 52db7ea21..e9c92c42e 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -788,39 +788,8 @@ ucenv (char *p, const char *eq)
}
}
-/* Set options from the registry. */
-static bool __stdcall
-regopt (PCWSTR name, char *buf)
-{
- bool parsed_something = false;
- UNICODE_STRING lname;
- size_t len = (wcslen(name) + 1) * sizeof (WCHAR);
- WCHAR lbuf[1024]; /* Use reasonable size to lower stack pressure.
- get_string alloca's this additionally and 1024
- is more than enough for CYGWIN env var values. */
-
- RtlInitEmptyUnicodeString(&lname, (PWCHAR) alloca (len), len);
- wcscpy(lname.Buffer, name);
- RtlDowncaseUnicodeString(&lname, &lname, FALSE);
-
- for (int i = 0; i < 2; i++)
- {
- reg_key r (i, KEY_READ, _WIDE (CYGWIN_INFO_PROGRAM_OPTIONS_NAME), NULL);
- if (NT_SUCCESS (r.get_string (lname.Buffer, lbuf, 1024, L"")))
- {
- sys_wcstombs (buf, NT_MAX_PATH, lbuf);
- parse_options (buf);
- parsed_something = true;
- break;
- }
- }
-
- MALLOC_CHECK;
- return parsed_something;
-}
-
-/* Initialize the environ array. Look for the CYGWIN environment
- environment variable and set appropriate options from it. */
+/* Initialize the environ array. Look for the CYGWIN environment variable and
+ set appropriate options from it. */
void
environ_init (char **envp, int envc)
{
@@ -830,18 +799,12 @@ environ_init (char **envp, int envc)
char *newp;
int sawTERM = 0;
bool envp_passed_in;
- bool got_something_from_registry;
static char NO_COPY cygterm[] = "TERM=cygwin";
tmp_pathbuf tp;
__try
{
char *tmpbuf = tp.t_get ();
- got_something_from_registry = regopt (L"default", tmpbuf);
- if (myself->progname[0])
- got_something_from_registry = regopt (myself->progname, tmpbuf)
- || got_something_from_registry;
-
if (!envp)
envp_passed_in = 0;
else
@@ -915,10 +878,6 @@ environ_init (char **envp, int envc)
if (p)
parse_options (p);
}
-
- if (got_something_from_registry)
- parse_options (NULL); /* possibly export registry settings to
- environment */
MALLOC_CHECK;
}
__except (NO_ERROR)
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index ea04c220c..2dca5bb5b 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -497,7 +497,6 @@ details. */
/* Identifiers used in the Win32 registry. */
#define CYGWIN_INFO_CYGWIN_REGISTRY_NAME "Cygwin"
-#define CYGWIN_INFO_PROGRAM_OPTIONS_NAME "Program Options"
#define CYGWIN_INFO_INSTALLATIONS_NAME "Installations"
/* The default cygdrive prefix. */