This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Enviroment always uppercased; Help me, please


Seems to be a cygwin "feature" that the environment will be uppercased, when
called by a none cygwin program.

When puting a variable "gar=1" into the environment and call a program
compiled with gcc and cygwin, the result, when printing the environment,
will be
GAR=1

ups, gar != GAR, especially in a POSIX environment!

When compiling the program with MS Developer Studio C++ the printed result
will be
gar=1
and that's okay.

Is there a trick to switch to a "POSIX" mode in cygwin and leave the case of
the environment unchanged?


parameter.c:
#include <stdlib.h>
#include <stdio.h>

int main ( int argc, char **argv, char **envp)
{
   int i;
   char **wp;

   printf("Environment:\n");

   if (envp != NULL)
   	for (wp = envp; *wp != NULL; wp++)
                        printf("%s\n", *wp);


   printf("Parameters %d\n", argc);

   for (i=0;i<argc;i++)
   {
      printf("Parameter %d (len=%d) >>%s<<\n", i+1, strlen(argv[i]),
argv[i]);
   }

   return argc;
}

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]