delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/27/12:51:30

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <BDF28C498CFED4119D720002B330B89301200A7D@xhole.bre.de.adp.com>
From: "Markus K. E. Kommant" <Markus DOT Kommant AT de DOT adp DOT com>
To: cygwin AT cygwin DOT com
Subject: Enviroment always uppercased; Help me, please
Date: Wed, 27 Feb 2002 18:46:57 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019