Index: winsup/cygwin/environ.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/environ.cc,v
retrieving revision 1.108
diff -c -r1.108 environ.cc
*** winsup/cygwin/environ.cc 12 Jan 2005 22:40:45 -0000 1.108
--- winsup/cygwin/environ.cc 14 Jan 2005 19:18:31 -0000
***************
*** 39,44 ****
--- 39,45 ----
#ifdef USE_SERVER
extern bool allow_server;
#endif
+ bool uppercase_env = true;
static char **lastenviron;
***************
*** 542,547 ****
--- 543,549 ----
{"subauth_id", {func: &subauth_id_init}, isfunc, NULL, {{0}, {0}}},
{"title", {&display_title}, justset, NULL, {{false}, {true}}},
{"tty", {NULL}, set_process_state, NULL, {{0}, {PID_USETTY}}},
+ {"uppercase_env", {&uppercase_env}, justset, NULL, {{false}, {true}}},
{"winsymlinks", {&allow_winsymlinks}, justset, NULL, {{false}, {true}}},
{NULL, {0}, justset, 0, {{0}, {0}}}
};
***************
*** 721,726 ****
--- 723,739 ----
lastenviron = envp = (char **) malloc ((4 + (envc = 100)) * sizeof (char *));
rawenv = GetEnvironmentStrings ();
+ /* Before processing env. variables, find the CYGWIN variable and parse it,
+ in case uppercase_env has been unset by the user. */
+ for (p = rawenv; *p != '\0'; p = strchr (p, '\0') + 1)
+ {
+ if(!strnicmp(p, "CYGWIN=", strlen("CYGWIN="))) {
+ char *eq = strechr (p, '=');
+ parse_options(eq+1);
+ break;
+ }
+ }
+
/* Current directory information is recorded as variables of the
form "=X:=X:\foo\bar; these must be changed into something legal
(we could just ignore them but maybe an application will
***************
*** 734,745 ****
if (*newp == '=')
*newp = '!';
char *eq = strechr (newp, '=');
! if (!child_proc_info)
ucenv (newp, eq);
if (*newp == 'T' && strncmp (newp, "TERM=", 5) == 0)
sawTERM = 1;
- if (*newp == 'C' && strncmp (newp, "CYGWIN=", sizeof ("CYGWIN=") - 1) == 0)
- parse_options (newp + sizeof ("CYGWIN=") - 1);
if (*eq && conv_start_chars[(unsigned char)envp[i][0]])
posify (envp + i, *++eq ? eq : --eq);
debug_printf ("%p: %s", envp[i], envp[i]);
--- 747,756 ----
if (*newp == '=')
*newp = '!';
char *eq = strechr (newp, '=');
! if (!child_proc_info && (uppercase_env || (!strnicmp(newp, "PATH=", 5))))
ucenv (newp, eq);
if (*newp == 'T' && strncmp (newp, "TERM=", 5) == 0)
sawTERM = 1;
if (*eq && conv_start_chars[(unsigned char)envp[i][0]])
posify (envp + i, *++eq ? eq : --eq);
debug_printf ("%p: %s", envp[i], envp[i]);
Index: winsup/doc/cygwinenv.sgml
===================================================================
RCS file: /cvs/src/src/winsup/doc/cygwinenv.sgml,v
retrieving revision 1.16
diff -c -r1.16 cygwinenv.sgml
*** winsup/doc/cygwinenv.sgml 24 Dec 2004 21:58:38 -0000 1.16
--- winsup/doc/cygwinenv.sgml 14 Jan 2005 19:18:33 -0000
***************
*** 169,174 ****
--- 169,181 ----
and it cannot be changed in the shell.
+ (no)uppercase_env - if set, Cygwin automatically converts
+ all Windows environment variables to upper-case. If not set, only the PATH
+ environment variable will be automatically converted to upper-case; the rest
+ will be left in the same state as they are in the Windows environment. Defaults
+ to set.
+
+
(no)winsymlinks - if set, Cygwin creates
symlinks as Windows shortcuts with a special header and the R/O attribute
set. If not set, Cygwin creates symlinks as plain files with a magic number,