* environ.cc (create_upcaseenv): Delete.
(ucenv): Don't honor create_upcaseenv. (environ_init): Remove early retrieval of CYGWIN environment variable. Change comment to reflect new behavior.
This commit is contained in:
parent
b6510ccdcd
commit
1516a0b4d7
@ -1,3 +1,10 @@
|
|||||||
|
2011-06-10 Christopher Faylor <me.cygwin2011@cgf.cx>
|
||||||
|
|
||||||
|
* environ.cc (create_upcaseenv): Delete.
|
||||||
|
(ucenv): Don't honor create_upcaseenv.
|
||||||
|
(environ_init): Remove early retrieval of CYGWIN environment variable.
|
||||||
|
Change comment to reflect new behavior.
|
||||||
|
|
||||||
2011-06-09 Christopher Faylor <me.cygwin2011@cgf.cx>
|
2011-06-09 Christopher Faylor <me.cygwin2011@cgf.cx>
|
||||||
|
|
||||||
* child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
|
* child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
|
||||||
|
@ -36,7 +36,6 @@ extern bool dos_file_warning;
|
|||||||
extern bool ignore_case_with_glob;
|
extern bool ignore_case_with_glob;
|
||||||
extern bool allow_winsymlinks;
|
extern bool allow_winsymlinks;
|
||||||
bool reset_com = false;
|
bool reset_com = false;
|
||||||
static bool create_upcaseenv = false;
|
|
||||||
|
|
||||||
static char **lastenviron;
|
static char **lastenviron;
|
||||||
|
|
||||||
@ -124,7 +123,6 @@ static struct parse_thing
|
|||||||
{"proc_retry", {func: set_proc_retry}, isfunc, NULL, {{0}, {5}}},
|
{"proc_retry", {func: set_proc_retry}, isfunc, NULL, {{0}, {5}}},
|
||||||
{"reset_com", {&reset_com}, justset, NULL, {{false}, {true}}},
|
{"reset_com", {&reset_com}, justset, NULL, {{false}, {true}}},
|
||||||
{"tty", {func: tty_is_gone}, isfunc, NULL, {{0}, {0}}},
|
{"tty", {func: tty_is_gone}, isfunc, NULL, {{0}, {0}}},
|
||||||
{"upcaseenv", {&create_upcaseenv}, justset, NULL, {{false}, {true}}},
|
|
||||||
{"winsymlinks", {&allow_winsymlinks}, justset, NULL, {{false}, {true}}},
|
{"winsymlinks", {&allow_winsymlinks}, justset, NULL, {{false}, {true}}},
|
||||||
{NULL, {0}, justset, 0, {{0}, {0}}}
|
{NULL, {0}, justset, 0, {{0}, {0}}}
|
||||||
};
|
};
|
||||||
@ -661,28 +659,12 @@ static const char idx_arr[] = "ACHNOPSTW";
|
|||||||
starts. */
|
starts. */
|
||||||
static const int start_at[] = { 0, 1, 4, 7, 8, 9, 16, 18, 22 };
|
static const int start_at[] = { 0, 1, 4, 7, 8, 9, 16, 18, 22 };
|
||||||
|
|
||||||
/* Turn environment variable part of a=b string into uppercase.
|
/* Turn environment variable part of a=b string into uppercase - for some
|
||||||
Conditionally controlled by upcaseenv CYGWIN setting. */
|
environment variables only. */
|
||||||
static __inline__ void
|
static __inline__ void
|
||||||
ucenv (char *p, const char *eq)
|
ucenv (char *p, const char *eq)
|
||||||
{
|
{
|
||||||
if (create_upcaseenv)
|
/* Hopefully as quickly as possible - only upper case specific set of important
|
||||||
{
|
|
||||||
/* Amazingly, NT has a case sensitive environment name list,
|
|
||||||
but only sometimes.
|
|
||||||
It's normal to have NT set your "Path" to something.
|
|
||||||
Later, you set "PATH" to something else. This alters "Path".
|
|
||||||
But if you try and do a naive getenv on "PATH" you'll get nothing.
|
|
||||||
|
|
||||||
So we upper case the labels here to prevent confusion later but
|
|
||||||
we only do it for processes that are started by non-Cygwin programs. */
|
|
||||||
for (; p < eq; p++)
|
|
||||||
if (islower (*p))
|
|
||||||
*p = cyg_toupper (*p);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Hopefully as quickly as possible - only upcase specific set of important
|
|
||||||
Windows variables. */
|
Windows variables. */
|
||||||
char first = cyg_toupper (*p);
|
char first = cyg_toupper (*p);
|
||||||
const char *idx = strchr (idx_arr, first);
|
const char *idx = strchr (idx_arr, first);
|
||||||
@ -696,7 +678,6 @@ ucenv (char *p, const char *eq)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Set options from the registry. */
|
/* Set options from the registry. */
|
||||||
static bool __stdcall
|
static bool __stdcall
|
||||||
@ -788,15 +769,6 @@ environ_init (char **envp, int envc)
|
|||||||
/* Allocate space for environment + trailing NULL + CYGWIN env. */
|
/* Allocate space for environment + trailing NULL + CYGWIN env. */
|
||||||
lastenviron = envp = (char **) malloc ((4 + (envc = 100)) * sizeof (char *));
|
lastenviron = envp = (char **) malloc ((4 + (envc = 100)) * sizeof (char *));
|
||||||
|
|
||||||
/* We also need the CYGWIN variable early to know the value of the
|
|
||||||
CYGWIN=upcaseenv setting for the below loop. */
|
|
||||||
if ((i = GetEnvironmentVariableA ("CYGWIN", NULL, 0)))
|
|
||||||
{
|
|
||||||
char *buf = (char *) alloca (i);
|
|
||||||
GetEnvironmentVariableA ("CYGWIN", buf, i);
|
|
||||||
parse_options (buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
rawenv = GetEnvironmentStringsW ();
|
rawenv = GetEnvironmentStringsW ();
|
||||||
if (!rawenv)
|
if (!rawenv)
|
||||||
{
|
{
|
||||||
@ -818,7 +790,7 @@ environ_init (char **envp, int envc)
|
|||||||
if (*newp == '=')
|
if (*newp == '=')
|
||||||
*newp = '!';
|
*newp = '!';
|
||||||
char *eq = strechr (newp, '=');
|
char *eq = strechr (newp, '=');
|
||||||
ucenv (newp, eq); /* (possibly conditionally) uppercase env vars. */
|
ucenv (newp, eq); /* uppercase env vars which need it */
|
||||||
if (*newp == 'T' && strncmp (newp, "TERM=", 5) == 0)
|
if (*newp == 'T' && strncmp (newp, "TERM=", 5) == 0)
|
||||||
sawTERM = 1;
|
sawTERM = 1;
|
||||||
if (*eq && conv_start_chars[(unsigned char) envp[i][0]])
|
if (*eq && conv_start_chars[(unsigned char) envp[i][0]])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user